Multithreading with the AudioIODeviceCallback class


#1

Hi folks

 

I'm subclassing the AudioIODeviceCallback in order to implement a playback class for a small DSP system I'm building.

I've had no issues with JUCE so far which is great; I was wondering if someone could offer some advice on how to interact with the AudioIODeviceCallback class in a multithreaded environment

Specifically, I want to be able to access my subclasses members to modify them in a sperate thread while the AudioIODeviceCallback class runs in the background accessing its members for every audio write cycle.

My questions are:

a) Should I have a mutex over the members that I want to access or should I lock the entire class and access its members, before releasing?

b) Is there already facilities within JUCE for MT access of a AudioIODeviceCallback instance?