2 Important Things to Notice When Using Lock() Statement

added by razamit
3/7/2012 7:39:10 AM

2 Kicks, 81 Views

2 Important Things to Notice When Using Lock() Statement


2 comments

dpeterson
3/7/2012 11:29:46 AM
The lock statement doesn't really have anything to do with this scenario, the real problem lies with asynchrony.

razamit
3/7/2012 11:38:40 AM
That is part true. The threads are created in the order of the numbers. People tend to think that the first thread to reach the lock is going to be the first one out of it, that is very wrong!