Re: thread-safe FIFO queue
Re: thread-safe FIFO queue
- Subject: Re: thread-safe FIFO queue
- From: kelly jacklin <email@hidden>
- Date: Mon, 18 Apr 2005 15:43:05 -0700
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