Re: Threading question
Re: Threading question
- Subject: Re: Threading question
- From: Robert Chin <email@hidden>
- Date: Wed, 08 Feb 2012 09:49:16 -0800
Sorry, not to chime in too late, but OSAtomicEnqueue and
OSAtomicDequeue are not the functions you want for a FIFO queue. Those
queues are LIFO (and you can see some example of their usage in the
CoreAudio sample code). The FIFO calls you want are
OSAtomicFifoEnqueue and OSAtomicFifoDequeue, new in 10.7. Currently
they appear not to be documented in the man page, but you can read
about their use in libkern/OSAtomic.h.
As far as whether they "block" or not, that is kind of a complicated
question. Do you consider the equivalent of sitting in a while(1) loop
waiting for something else to complete blocking? Either that or
locking must happen. I don't think there's any sort of implied
constant time guarantee for the function returning specifically, but
it's likely to be quite short.
Robert
_______________________________________________
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