Export (0) Print
Expand All
4 out of 16 rated this helpful - Rate this topic

Choosing the Threading Model

Choosing the threading model for an object depends on the object's function. An object that does extensive I/O might support free-threading to provide maximum response to clients by allowing interface calls during I/O latency. On the other hand, an object that interacts with the user might support apartment threading to synchronize incoming COM calls with its window operations.

It is easier to support apartment threading in single-threaded apartments because COM provides synchronization on a per-call basis. Supporting free-threading is more difficult because the object must implement synchronization; however, response to clients may be better because synchronization can be implemented for smaller sections of code.

Related topics

Accessing Interfaces Across Apartments
Multithreaded Apartments
In-Process Server Threading Issues
Processes, Threads, and Apartments
Single-Threaded and Multithreaded Communication
Single-Threaded Apartments



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.