什么是 STA/MTA 与 apartments/free 线程与 UI threads/worker 线程?为什么名字会变?

What is STA/MTA vs apartments/free threads vs UI threads/worker threads? Why the name changes?

我正在阅读 Dale Rogerson 的 Inside COM,它使用术语 apartment threadsfree threads 来描述不同类型的 COM 线程。

他还澄清说这些直接对应于 UI 线程 工作线程 :

COM uses the same two types of threads, although COM has different names for them. Instead of calling one a user-interface thread, COM uses the term apartment thread. The term free thread is used instead of worker thread. [...]

但是,许多其他文档提到了 STAsMTAs。 “单线程单元”和“多线程单元”。

这些术语似乎可以互换:

COM synchronizes calls COM does not synchronize calls
STA (preferred name) MTA (preferred name)
"Apartment thread" Free thread
(often) UI thread (often) Worker thread

Descriptions and workings of OLE threading models 表示 STA == apartment threadMTA == free thread(即使两个新术语都使用“公寓”一词):

  1. Single-threaded Apartment model (STA): One or more threads in a process use COM and calls to COM objects are synchronized by COM. Interfaces are marshaled between threads. A degenerate case of the single-threaded apartment model, where only one thread in a given process uses COM, is called the single-threading model. Previous have sometimes referred to the STA model simply as the "apartment model."

  2. Multi-threaded Apartment model (MTA): One or more threads use COM and calls to COM objects associated with the MTA are made directly by all threads associated with the MTA without any interposition of system code between caller and object. Because multiple simultaneous clients may be calling objects more or less simultaneously (simultaneously on multi-processor systems), objects must synchronize their internal state by themselves. Interfaces are not marshaled between threads. Previous have sometimes referred to this model as the "free-threaded model."

根据罗杰森的说法,如上所述 apartment thread == UI threadfree thread == worker thread

COM uses the same two types of threads, although COM has different names for them. Instead of calling one a user-interface thread, COM uses the term apartment thread. The term free thread is used instead of worker thread. [...]

不过,我很想知道为什么术语发生了变化。