Multithreading and COM Apartments
In a multithreaded environment, COM objects use Apartments to synchronize access to resources that may be shared by multiple threads. Managed code objects use synchronization regions and synchronization primitives like monitors, mutexes, and locks for the same purpose. Yes, you read that correctly. Assuming that you are not using COM Interop (or Windows Forms), your managed code does not use Apartments. For those of you who never quite grasped the concept of COM Apartments, this is probably cause for celebration.
Note
I personally think that Microsoft dropping the Apartment concept in the .NET Framework is a tacit admission by them that the “fix”—COM Apartments—was worse than the original problem—the need to ...
Get .NET and COM Interoperability Handbook, The now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.