Sensomusic

#1 2018-02-24 23:46:02

sm_jamieson
Platinum Member

As I am writing more complex user modules, some programming concepts are arising !

Does any have details of the threads used for user module callbacks, e.g. the main processing audio thread, the message thread used for slow parameter callbacks, drawing, etc.

And does Usine call more than 1 thread at the same time in the same module ? In other words, if I process in the onProcess() and the onSettingsHasChanged() thread, might these occur at the same time and need thread-safe protections, mutexes etc. ?

Or does the SDK protect the user from thread interactions ?

Thanks,
Simon.

Offline

 

#2 2018-04-06 05:44:30

senso
Administrator

hi,
OnProcess is executed in an Audio thread.
OnSettingshasChanged works in the main IDLE thread
Callback is normally executed in the main IDLE thread except if you set the CallbackType = immediate, so it works in an audio thread.

In  most of cases you should use critical sections to protect you code if you have potential conflicts.


Olivier Sens
www.sensomusic.org

Offline