Tricks to avoid mutexes
Tricks to avoid mutexes
- Subject: Tricks to avoid mutexes
- From: Makira <email@hidden>
- Date: Wed, 19 Jan 2005 00:05:50 -0500
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.
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.
What happens for a dual cpu? When one is storing to memory and the other is
reading from it, is it possible that it might get an half new/half old copy?
I guess the question is: does both cpu can access the memory at the same
time ? Even if one is writing to it? When one cpu write, the cache line for
the other has to be updated..
I know it isn't good programming style to rely on such specific behavior,
but I'd like to avoid waiting a complete audio render cycle before applying
new paramaters.
Any suggestions/tricks ?
Thank you!
_______________________________________________
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