GUI layer threading

So far I have been assuming that the GUI layer is mono threaded/runs on an event loop like most other GUI layers (ex: Android, etc…) and I wanted to confirm that my understanding is correct.

I do understand that the GUI and the RT may (and will most likely) run on separate threads but because they don’t share any data it should never be an issue (except when the RT is asked to save its state which AFAIK happens from the GUI thread but I have already discussed this in another thread).

But within the GUI itself, can I assume that all implementations (=DAWs) are required to use some event loop and only a single thread to call all methods in the UI. One thing that comes to mind is that I have a Timer (Steinberg::Timer) and I want to make sure that the onTimer callback gets called serially with other GUI events and I do not have to handle synchronization in any way (for example, a onMouseDownEvent and onTimer event will always be serial, and never called from 2 different threads).

Thanks
Yan

Hi,
as stated in the documenation (https://steinbergmedia.github.io/vst3_doc/vstinterfaces/workflow.html#controllercallsequence), all edit controller calls must be done on the main thread.

Cheers,
Arne

This diagram/section does not talk about timers explicitly. Or am I missing something? Are timers callback also required to be called from the main thread?

Thanks
Yan

Hi,
Timers are not part of the SDK for macOS or Windows. So if you create a timer on these platforms you have to make sure that they are working as you expect. The VSTGUI timer class will post on that thread where you create it, so you have to make sure that this is happening on the main thread.

Cheers,
Arne