Critical sections work only on threads within the same process or application. The kernel-based synchronization objects Event, Mutex, and Semaphore can be used between threads and between processes. An event allows the signaller to signal one or more interested threads or processes of an event. The Mutex is an object that provides mutual exclusion between threads so that access to a resource can be serialized. A Semaphore provides a count limiting object.
Semaphores are useful in limiting the number of threads a resource dispenser creates.
Requests are honored up to a set limit, and thereafter requests are suspended until one of the previous threads releases or terminates. Since synchronizing objects is more costly in terms of performance, it is useful to know exactly when this synchronization is invoked and when it is not. If a single threaded apartment object calls another single threaded apartment object, COM will synchronize the call. If a single threaded apartment object calls a multi-threaded apartment object, then COM does not synchronize the call. And if a multi-threaded apartment object calls a single threaded apartment object, COM does synchronize the call.