Is it OK for a plugin to call IComponentHandler::restartComponent() from a random thread?

Hi,

I wonder if it is OK for a plugin to call IComponentHandler::restartComponent() from a random thread?
Or this method has to be called from the main thread?
What is the right way for plugin to figure out what is the main thread id?

Many thanks,
Alex

Hi Alex,
first, you can use the thread id of the current thread when your edit controller is created. All calls from the host to the IEditController instance must be done from that thread.
Second, try to always use the main thread when calling back to the host if you don’t find any threading documentation for that method.

Cheers,
Arne

Hi Arne,

Many thanks for your answer.

Did you mean “must” when you said “try”? :wink:

Regards,
Alex

Yes, you’re right.

Cheers,
Arne