Threading Models
COM objects support two primary threading models: single-threaded apartment (STA, also known as “apartment-threaded”) and multithreaded apartment (MTA, also known as “free-threaded”). Don't let the “apartment” concept confuse you or scare you away. The term helps define a conceptual framework that describes the relationships among threads, objects, and processes. It establishes an analogy wherein a process is the equivalent of a building, and the logical container in which COM threads and objects exist within a process is an apartment—that is, a set of rooms within the building. Thus an apartment is simply a logical container within a process. As the analogy suggests, an apartment might contain multiple threads and/or objects, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access