Do I need a job queue on my COM server?
I have an out of line COM EXE server that exposes an API from one of its interfaces. The functionality of this API is to host URLs.
My client will instantiate a COM server and call this API with new urls.
Every time a client has to publish a URL, it creates an instance of that COM server.
Do I need to implement a queue on the COM server to keep track of all the urls sent by the client and make sure nothing is lost?
What am I wondering if every time I create a COM object a new process gets started? If so, I think I don't need to implement the job queue on the server.
But if only one instance remains in memory, is it possible that jobs / urls submitted by the client might be lost.
a source to share
COM usually starts one server process for all requests and instantiates all objects in that process. If you have data that is shared between all objects (globals or static member variables), you must either take care of synchronization or make a COM Composite Apartment (STA).
If you don't have synchronization and the component is multithreaded (MTA), all data shared between instances is prone to corruption if written by more than one thread at a time.
a source to share