Most existing COM objects are not thread-safe. That is, clients are required to make all calls to the COM object from a single thread. This thread is also regularly required to process Microsoft® Windows® messages. This allows other threads to marshal calls to objects on that thread. It also ensures that system message broadcasts do not get blocked. (A thread that regularly processes Windows messages is said to have a message "pump.")
Furthermore, some COM objects are not even apartment-aware. These objects are not only restricted to a single thread, but are restricted to a specific thread known as the main apartment thread. The first thread that calls CoInitialize becomes the main apartment thread for the process.
The following sections describe how the Microsoft VM instantiates COM objects and creates marshaling proxies while hiding the details from the Java programmer.
Instantiating New COM Objects compares how new objects are instantiated, depending on their threading model.