Hi,
in short: What's SyncLock?
thx
Printable View
Hi,
in short: What's SyncLock?
thx
it is not easy to explain it in a short time, you had better check a book for details.
basically, if you are not using multi-thread, you do not need use it. synclock locks the variables, so multithreads can not share it at the same time.
Dont think i need any more details, that very much clarifies it, but it's supposed to lock the variables for a specified thread from all the other threads, right?Quote:
Originally Posted by temp_12000
Only one thread can enter a SyncLock block at a time, so if one thread is currently executing code within the SyncLock block then any other threads will wait until that thread exits the block before ONE AND ONLY ONE of them enters. It is up to the system which is the lucky winner. I don't think that the order in which they arrive has any bearing on the order in which they enter. If several SyncLock blocks are passed the same object via their expressions then those SyncLock blocks are linked and no thread may enter any of them if another thread is currently executing any of them, whether it's the same block or not.
Thx, that covers itQuote:
Originally Posted by jmcilhinney