Welcome to %s forums

BrainModular Users Forum

Login Register

sdk user module threads

Create your own modules in C++
Post Reply
sm_jamieson
Member
Posts: 551
Contact:

Unread post by sm_jamieson » 25 Feb 2018, 00:46

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.

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 06 Apr 2018, 07:44

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests