AudioProcessor::processBlock() and Thread::notify() - is it lock-free?


#1

Simple question, can be used Thread::notify() (to trigger an external thread) inside the AudioProcessor::processBlock()? Or does it perform any lock and it should be forbidden?


#2

Sure, you’re almost certainly safe to call that.


#3

Thank you, really appreciated


#4

I’m on macOS - Thread::notify() calls WaitableEvent::signal(), and on a Posix system, this function calls pthread_mutex_lock (&mutex).

Unless macOS supports priority inheritance from realtime threads to normal Posix threads (does it? I don’t know…), I’d rather avoid calling Thread::notify() on a realtime thread/audio callback.