CoreAudio server plugin RunLoop for MatchingNotification

Hi, to be able to receive IOServiceAddMatchingNotification we need to attach to an appropriate CFRunLoop/IONotificationPort. To avoid race condition the matching notification ideally would be serialized with the CoreAudio notification/callbacks. How can this be achieved? Attaching it to the runloop returned by CFRunLoopGetCurrent() does not yield to any notifications at all, to CFRunLoopGetMain leads to notifications asynchronous to CoreAudio callbacks.

There are a set of deprecated AudioHardwareAdd/RemoveRunLoopSource() but apart of its deprecation at least on Big Sur @ Apple Silicon this does not lead to any notification as well.

So, how is this supposed to be implemented? Do we really need to introduce locks? Also on the process calls? Wasn't it the purpose of runloops to manage exactly those kinds of situation? And more importantly over everything: Where is the documentation?

Thanks for any hints, all the best, hagen.

Thanks for giving the space to get lost in soliloquies! After this breathing practice, I would now like to get back to work and finish the exercise, for example with the help of an appropriate documentation or a hint from the people behind the API/technology. Or you could also just tell me that your operating system does not need my support, then I could go straight to the beach and wouldn't need to wait for the bus here.

CoreAudio server plugin RunLoop for MatchingNotification
 
 
Q