I wanted to ask for a suggestion on how to perform polling on a Twine thread.
I need my new thread to be ready to perform a routine when a condition is met in the audio thread: in the worker callback I have set up a while loop with a termination flag and an if condition inside, which should check for available data in a ring buffer.
As it is I’m starving xenomai since I have no sleep function in place:
Can I use
std::this_thread::sleep_for or should I clone the xenomai repository and use
I’ve also been looking for an alternative to polling, however, I don’t think I can use the
wakeup_workers function to signal the rt thread, since my triggering condition happens in the audio thread and that function should be a blocking one. I don’t think can use
RtConditionVariable either, since the documentation says that it is used to signal a lower priority non-real-time thread.
Please let me know if there is a nicer way to signal rt threads from other rt threads.