Page 1 of 1

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

Posted: Thu Jan 10, 2019 8:48 am
by abique
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

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

Posted: Thu Jan 10, 2019 9:23 am
by Arne Scheffler
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

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

Posted: Thu Jan 10, 2019 8:01 pm
by abique
Hi Arne,

Many thanks for your answer.

Did you mean "must" when you said "try"? ;-)

Regards,
Alex

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

Posted: Fri Jan 11, 2019 12:50 pm
by Arne Scheffler
Yes, you're right.

Cheers,
Arne