Threading problem in COM service
Posted on 2002-07-02
I have COM NT service and two interfaces in it. Lets say someone calls method DoSomething from first interface IOne. This method should wait for some event (e.g. certain value in DB, or something like that) and then return it to the caller. The point is, calls to this and other interfaces should be possible during execution of this method.
So here is my problem: other calls aren't possible until execution of first method isn't over.
I've tried to change interface threading model from Apartment (default) to Free. It doesn't help.
Here's code of DoSomething:
STDMETHODIMP COne::DoSomething(short *iRetVal)
*iRetVal = 555;
Maybe Sleep() doesn't provide "interrupt" for other processes to be called? I've tried other wait functions (SleepEx, WaitForMultipleObjectEx), it's all the same.