apartments

Could you explain STA and MTA?

青春壹個敷衍的年華 提交于 2019-11-26 03:14:06
问题 Can you explain STA and MTA in your own words? Also, what are apartment threads and do they pertain only to COM? If so, why? 回答1: The COM threading model is called an "apartment" model, where the execution context of initialized COM objects is associated with either a single thread (Single Thread Apartment) or many threads (Multi Thread Apartment). In this model, a COM object, once initialized in an apartment, is part of that apartment for the duration of its runtime. The STA model is used