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. Supporting free-threading is more difficult because the object must implement synchronization, but response to clients may be better because synchronization can be implemented for smaller sections of code. In single-threaded apartments, COM provides synchronization on a per-call basis.