Question

I have an out of proc COM (ATL) Server that has been created as free threaded (CComMultiThreadModel)

I am slightly confused as to how that relates to the re-entrancy of calls into my object, for example I assumed that I would be allowed to call from multiple clients simultaneously and have those requests processed simultaneously however it seems (according to my logs) that each request is serialized.

What am I missing, does simply creating a class as MTA mean it truly is or is there something else I have to do. Note that I am referring here to multiple processes all making concurrent calls and not threads within a single process and thus COINIT_MULTITHREADED is not the problem.

This snippet from some MS documentation on MTA would seem everything should work out of the box:

Multiple clients can simultaneously call, from different threads, an object that supports free-threading. In free-threaded out-of-process servers, COM, through the RPC subsystem, creates a pool of threads in the server process and a client call (or multiple client calls) can be delivered by any of these threads at any time

Was it helpful?

Solution

No sooner than I asked it I found the answer, you need to specify #define _ATL_FREE_THREADED in stdafx.h

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top