Re: thread-safe FIFO queue
Re: thread-safe FIFO queue
- Subject: Re: thread-safe FIFO queue
- From: William Stewart <email@hidden>
- Date: Tue, 19 Apr 2005 10:45:13 -0700
There's also some lock-less buffer code in the SDK (based on Kelly's
original posts)... Have a look in the AUValidSamples AU (in
DiagnosticAUs) which uses a LockFreeFIFO for this kind of thing.
Bill
On 18/04/2005, at 3:43 PM, kelly jacklin wrote:
On Apr 18, 2005, at 1:16 PM, George Warner wrote:
MP queues are mutex protected FIFO's.
Be aware that these can _not_ be used from an IOProc, since they
used a lock (mutex), and thus offer the potential to block the
IOProc, which is a realtime thread; blocking the IOProc is a
definite no-no.
You need a lock-less solution that still guarantees forward
progress. There has been plenty of design work in this area, so
you should be able to find some discussion of lock-less data
structures on the web. I also posted a lock-less solution for
buffer arbitration between the IOProc and another (single) thread
to this list quite some time ago, so you might want to search the
archives (searching for CompareAndSwap or CAS might be a good
start). For your situation, perhaps a simple ring buffer with CAS-
controlled position pointers would work?
Let me know if you need more precise help, and I might be able to
dig up the e-mail, or perhaps even locate some code...
kelly jacklin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden