Appendix B. COM+ Synchronization Through Activities

Writing a thread-safe component—that is, one that can safely be called by multiple threads at any time—has always been a challenge. Such development demands knowledge of semaphores, mutexes, critical sections, and other forms of OS thread locking primitives. These must be set like sentinels at the gates of every resource in a process that requires serialized access.

COM offers protection for objects that might be called concurrently by multiple threads, but cannot or do not employ any form of mutual exclusion primitive (mutex, semaphores, and so on). This protection comes in the form of the Single-Threaded Apartment (STA), which, as discussed in Chapter 4, "Threading and Apartment Models," serializes ...

Get Applying COM+ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.