Call to C++ COM interface from C# being blocked
- by dauphic
I have a C++ DLL that exposes a COM interface. A C# application uses the COM interface. I've recently run into a problem where some calls to the COM interface are taking 500-5000 ms to return, though they should return almost instantly (no longer than 10 ms).
Profiling the application shows that all of the delay is being caused by the 'thread being blocked;' no other information is available. There are no locks, etc. in my code, so the blocking has to be occurring internally in the COM/interop code.
Only one thread interfaces with the COM DLL.
Any ideas what could be causing this, and how I would fix it?
EDIT: Further investigation shows that the block is occuring when the C++ returns to the C#.