Error!
Success!

Multithreading: Which lock object should i use?

0
kicks

Multithreading: Which lock object should i use?  (Unpublished)

The lock keyword locks a specified code block so two threads can't process the same code block at the same time. When one threads exits the locked block, another thread can enter the locked code block. The Monitor class offers the same functionality, but you specifiy the start and end of the locked code block with Monitor.Enter and Monitor.Exit. For both techniques you need a variable to lock on, but what sort of variable should you use?


Kicked By:
Drop Kicked By: