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

SDK for VST 3 audio plug-in and host development.
Post Reply
abique
Posts: 39
Joined: Tue Jun 21, 2016 12:43 pm

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

Post by abique » Thu Jan 10, 2019 8:48 am

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

Arne Scheffler
Posts: 303
Joined: Mon Jun 20, 2016 7:53 am

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

Post by Arne Scheffler » Thu Jan 10, 2019 9:23 am

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

abique
Posts: 39
Joined: Tue Jun 21, 2016 12:43 pm

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

Post by abique » Thu Jan 10, 2019 8:01 pm

Hi Arne,

Many thanks for your answer.

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

Regards,
Alex

Arne Scheffler
Posts: 303
Joined: Mon Jun 20, 2016 7:53 am

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

Post by Arne Scheffler » Fri Jan 11, 2019 12:50 pm

Yes, you're right.

Cheers,
Arne

Post Reply