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: Paul Davis <email@hidden>
- Date: Sat, 26 Mar 2011 22:12:14 -0400
On Sat, Mar 26, 2011 at 10:00 PM, Kyle Sluder <email@hidden> wrote:
> On Sat, Mar 26, 2011 at 2:57 PM, Paul Davis <email@hidden> wrote:
>>
>> ordering: you cannot control this without using write/read barriers,
>> not within a thread let alone between threads.
>
> Do threads have processor affinity? If so, then you shouldn't need
> write barriers within the same thread. And even if threads don't have
> processor affinity, if the machine is going to switch your thread onto
> a different core, wouldn't the entire SMP model would break down if it
> didn't preserve ordering?
>
> It is entirely possible that I am misunderstanding something here, but
> I was under the impression that a single thread does not need to issue
> read and write barriers.
i was referring to instruction reordering, which is not likely to have
an impact on a given thread (unless the compiler has a bug, which is
not unknown but unlikely). however, instruction reordering does mean
that you can't reason about cross-thread interactions in a way that is
based on a straightforward reading of the source code or even the
assembler in some cases.
if you want to be able to say "thread A does X, then Y then Z" and
there is no data dependence between X, Y and Z, you need barriers to
keep that ordering intact. on the other hand, if you're relying on the
ordering in another thread, you're already dead in the water, so give
up now :)
_______________________________________________
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