3 ms·
COM was popular, yes, but it was a nighmare. Remember all the threading models? Here's just a taste: When a free-threaded apartment (multithreaded apartment mo
by ams6110 11y ago
COM was popular, yes, but it was a nighmare. Remember all the threading models? Here's just a taste:
When a free-threaded apartment (multithreaded apartment model) in a client creates an apartment-threaded in-process server, COM spins up a single-threaded apartment model "host" thread in the client. This host thread will create the object, and the interface pointer will be marshaled back to the client's free-threaded apartment. Similarly, when a single-threaded apartment in an apartment-model client creates a free-threaded in-process server, COM spins up a free-threaded host thread (multithreaded apartment on which the object will be created and then marshaled back to the client single-threaded apartment).
I remember thinking I sort of understood this back in the day, but now I'm pretty sure I didn't.