Ganesh Chavan

Ganesh Chavan

  • NA
  • 3
  • 461

COM and multithreading

Oct 26 2017 7:32 AM
I have a CAD plugin application. In my CAD application program, CAD may have restrictions about which thread can be used to modify the CAD body. Here is my requirements:
  • Since COM call are received on different threads, then the plug-in must ensure that all construction calls are made in the right thread (the main one).
  • Also, since the kernel can call the plug-in while the CAD is busy, the plug-in must ensure that it can safely call the constuction thread without creating a deadlock.
A valid solution could be to check if the Main (construction) thread is busy before trying to use it.
 
So my question is: How to check If main thread is busy or not?