

When the next thread acquires a lock on the locking object it will then try to enter the context, which is still locked resulting in a deadlock. Net runtime will allow other threads access to the locked object since an exit method has been called. This allows other threads to then get access to the context avoiding deadlocks. True tells COM+ to exit its synchronized context before the runtime allows the thread to wait. If your classes use COM+ synchronization True should be passed for this parameter or deadlocks are risked.

Recall that the second parameter of the method was a boolean method that determined whether to release the synchronized context along with the object lock. The service guarantees that only one thread is available to run each object at a time.Įarlier the timed methods of the WaitHandle classes were discussed. COM+ will marshal all calls across this proxy where a performance penalty occurs. When you use the attribute, COM+ will create a proxy for you that will run all instances of your object in its context. For further reading on COM+ get a copy of Professional Visual Basic Interoperability – COM and VB6 to. Entire books have been written on the subject of COM+. This case study will give a brief overview of this topic, as it is out of the scope of the article. This tells the runtime to provide synchronization for the entire class by making each class instance only accessible by one thread at a time. When deriving a class from ContextBoundObject, the attribute can be used. This method can be implemented on any class that is derived from ContextBoundObject, or from any class that derives from ContextBoundObject. This synchronization method allows the usage of a concept called a context to provide ways to lock code for synchronization. COM+ offers developers many helpful techniques such as transaction handling between objects, loosely coupled events, object pooling and synchronization, which we will discuss here, to name a few. The dot net framework provides many enterprise services that can be used to build enterprise applications, one of which is the COM+ method of synchronization.
