MacOS Audio Thread Workgroups

Thanks for the examples @tlacael

So I managed to get audio workgroups stuff to work for AU plugins/audio threads (see FR: Thread-Priority vs Efficiency/Performance Cores - #27 by wavesequencer), but I’m not sure where I will add the similar appropriate code for standalone builds - in my case I am using the JUCE Thread class (so I don’t need to set up the real-time stuff as it’s handled in ‘startRealtimeThread’ function). I bridge the C++ to objective C++/.mm side of things via callbacks that get registered by calling into PluginProcessor from juce_AU_Wrapper.mm.

I saw that I can retrieve the audio device name in ‘audioDeviceAboutToStart’ function within juce_StandaloneFilterWindow.h (seems like a good place since device can change so workgroup can also change at run-time) - but maybe there is a better place to implement the necessary code. It probably needs to be in a separate objective C class/file to avoid type clashing with JUCE namespace classes - since there’s no equivalent .mm wrapper for standalone.
With the device name, it’s possible to retrieve the associated workgroup following your example above @tlacael.

Any advice folks on the best place to retrieve device name and still be able to call into ‘pluginProcessor’ to set my thread workgroup registration callbacks?

I am also trying to figure where to do the same for VST3.
(Or maybe there’s a better approach entirely.)