Every instance of CLR object can be used as lock. The usual C# syntax
for it is:

void foo() {
   lock(this) {
      ...
   }
}

This mechanism is implemented using syncblocks in the SSCLI. Only a
small fraction of the objects is used as locks in realworld programs. To
save resources, the data structure for locking is initialized on demand
only after the object is actually used as lock. This on demand created
data structure is what is called the syncblock.

The CLR does not do any implicit locking. It is the responsibility of
the user code to guarantee the proper synchronization.

-Jan

This posting is provided "AS IS" with no warranties, and confers no
rights.

-----Original Message-----
From: Archana [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 05, 2003 8:59 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET-ROTOR] object synchronization

Hi,
 Rotor documentation talks about syncblk routines as ones that provide
runtime support wrt object synchronization,
Does this mean sync-ing when many threads are trying to access the
object at once ? At which level sync-ing is implied
are there any other pointers that explain about sync blocks, why they
are required etc.. in detail ?

Regards

Reply via email to