0

I am trying to decipher the paragraph below, taken from a blog post here which describes COM history in the context of the development for the Visual Studio IDE:

When everything was C++ native code, COM ensured that almost everything happened on the main STA thread (i.e. the UI thread). If code running in another apartment (e.g. a background thread) called any of these COM components the background thread would block while the call was re-issued on the main thread. This protected the COM component from having to deal with concurrent execution, but left it open to reentrancy (being invoked while in an outbound call). This technique worked whether the caller was managed (automatically) or native code (via the proxy stub that COM would generate for the caller).

The questions I have:

What is the mechanism by which a call is re-issued on another thread? Can you give an example?

Is the problem mentioned as ‘concurrent execution’ the same as that of thread safety?

What is being invoked while on an outbound call?

Thank you.

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
  • See if [this helps](https://support.microsoft.com/en-us/help/150777/info-descriptions-and-workings-of-ole-threading-models). The worker thread gets a proxy to the COM object running in STA. When it calls a method on the proxy, the proxy sends a message to a hidden window that belongs to the STA; this blocks the worker thread until the message is processed. The handler of that message then calls the corresponding stub, which in turns calls the actual object method. – Igor Tandetnik Jul 08 '20 at 20:00
  • @IgorTandetnik Thank you. – Sabuncu Jul 09 '20 at 15:55

0 Answers0