Monday, August 6, 2007

Critical Section in C#

Here is a good article on using the lock statement to create critical sections in C#:

Here is the gist:

Object lockobj = new Object();

lock (lockobj)
// Do your locked work


Anonymous said...

Another noteworthy article

Elton Beach said...

Locking on this is bad though because some other line could conceivably
lock on this developing a state of chaos of types. But that provides you with roughly the comparative of a crucial area.