Re: [linux-audio-dev] lock-free data structures

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] lock-free data structures
From: Joshua Haberman (joshua_AT_reverberate.org)
Date: Fri Jun 18 2004 - 06:27:43 EEST


On Jun 17, 2004, at 6:00 PM, Paul Davis wrote:
>> in a lock-free way. This ensures zero-copy operation.
>
> until you want to start processing the data but keep the original
> around. i was always attached to the zero-copy model, but it just
> doesn't seem to pan out in real life.

The multiple buffer approach could provide this, no?

Your callback copies incoming data into a buffer (this much is
unavoidable). Then you send away a pointer to that buffer, and keep
the pointer for yourself. You have a "buffer pool" object that
reference-counts all your buffers (this is possible to make lock-free
and thread-safe), and returns buffers to a free list when the
reference-count hits zero (also possible to make lock-free and
thread-safe).

Josh


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jun 18 2004 - 06:20:56 EEST