[LAD] easiest way to serialize messages for sending over a ringbuffer?

Paul Coccoli pcoccoli at gmail.com
Wed Dec 14 22:27:39 UTC 2011


On Wed, Dec 14, 2011 at 4:54 PM, Paul Davis <paul at linuxaudiosystems.com> wrote:
> On Wed, Dec 14, 2011 at 4:52 PM, Paul Coccoli <pcoccoli at gmail.com> wrote:
>
>> Can you send a pointer to your struct over the ringbuffer instead?
>
> only if you establish very clear rules about buffer ownership. that
> can be tricky to do.

Agreed about the ownership rules, but I don't think it's that tricky.
Use one ringbuffer to pass pointer into the RT thread and another to
pass them back to the "main" (non-RT) thread.  The non-RT thread is
then responsible for all memory management.  You wouldn't call
free/delete in an RT thread anyway, would you?



More information about the Linux-audio-dev mailing list