[LAD] Writing to an eventfd from a realtime thread

Paul Davis paul at linuxaudiosystems.com
Wed Sep 24 22:46:04 UTC 2014


On Wed, Sep 24, 2014 at 6:15 PM, karthik poduval <karthik.poduval at gmail.com>
wrote:

> You could also use a jack_rigbuffer_t, its lock free and hence should be
> RT thread safe.
> You could write a known msg into the ring buffer from the RT thread,
> receive the msg from non real-time thread and do event passing from there.
>

Nope. the poster is looking for a way to notify a different thread that it
would be worth checking out the contents of a ringbuffer.

There are only two ways to do this: either wake the other thread regularly
based on a timer, and hope that the chosen interval and accuracy are enough
to keep the buffer (empty|full) OR wake the other thread as needed. this
second option requires some sort of communication channel to the thread to
wake it, which could be (on linux) any of a pthread_condvar, a semaphore, a
FIFO/pipe, and eventfd, etc. etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20140924/2a9b8892/attachment.html>


More information about the Linux-audio-dev mailing list