Re: best practices for sending data from UI to RemoteIO callback thread
Re: best practices for sending data from UI to RemoteIO callback thread
- Subject: Re: best practices for sending data from UI to RemoteIO callback thread
- From: Morgan Packard <email@hidden>
- Date: Sat, 26 Mar 2011 15:33:30 -0600
Thanks Paul,
So, would using a circular buffer / message queue technique like the
one described by wm schauweker be the generally preferred way of
sending commands from a UI to a real-time audio thread?
-Morgan
On Sat, Mar 26, 2011 at 3:29 PM, Paul Davis <email@hidden> wrote:
> On Sat, Mar 26, 2011 at 5:25 PM, Morgan Packard
> <email@hidden> wrote:
>> So, after looking at your code, looks like the only piece data shared
>> by the producer and consumer is this hasCommand_ flag. Is it unsafe to
>> even increment and decrement a shared value (meaning a value that more
>> than one thread is writing to) without using these OSAtomicIncrement
>> functions? Perhaps that may be the reason for the mysterious failures
>> I get once in a blue moon.
>
> it is never safe unless you know that re-ordered read/writes of the
> value will cause no damage. there are cases where this is true;
> generally, its false.
> _______________________________________________
> 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
>
--
================================
Web:
http://www.morganpackard.com
Music/Art:
Latest album: Moment Again Elsewhere
iOS app Thicket available on iTunes store.
================================
_______________________________________________
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