RE: Threading Question
RE: Threading Question
- Subject: RE: Threading Question
- From: Hari Karam Singh <email@hidden>
- Date: Mon, 13 Feb 2012 09:22:53 +0000
- Expiry-date: Thu, 12 Apr 2012 23:00:00 +0000
- Organization: AncientBohemia Ltd.
> The code linked to does not have any memory barriers at all. There is
> nothing stopping writes from the memcpy (in
> TPCircularBufferProduceBytes) being reordered (by the CPU) such that
> they become visible after the OSAtomicAdd32 (in
> TPCircularBufferProduce). There needs to be a write barrier after the
> memcpy in order to be safe.
I noticed this before too. Can't it be remedied just by adding "Barrier" to the end of the OSAtomic function names? Also is there any reason not to "inline" these functions?
HKS
_______________________________________________
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