Re: Tricks to avoid mutexes
Re: Tricks to avoid mutexes
- Subject: Re: Tricks to avoid mutexes
- From: Ben Dougall <email@hidden>
- Date: Wed, 19 Jan 2005 12:05:22 +0000
On Wednesday, January 19, 2005, at 05:05 am, Makira wrote:
I'm working on an AudioUnit.
I'd basically like to know if storing an int/float/double is atomic.
More exactly, if the storing instruction does comit all bytes into
memory at
once.
i asked this question on the multithreading list a little while ago.
i'm pretty sure the answer is yes -- if you're storing or reading a
32bit value on a 32bit machine (or 64bit value on a 64bit machine)
that's aligned correctly the read or write operation is atomic.
For a mono cpu this is most likely true, since a context change cannot
happen in the middle of an instruction (afaik). I don't mind if a
thread
gets an old copy of the data: I just don't want it to get a corrupted
copy.
that was pretty much exactly my motivation -- might be worth searching
mt-smp list archives. the thread was titled "no need to lock shared
data in this situation?"
_______________________________________________
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