• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Tricks to avoid mutexes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Tricks to avoid mutexes
      • From: Ben Dougall <email@hidden>
  • Prev by Date: Re: OS X USB/Midi Driver bugs?
  • Next by Date: Re: OS X USB/Midi Driver bugs?
  • Previous by thread: RE: Re: OS X USB/Midi Driver bugs?
  • Next by thread: Re: Tricks to avoid mutexes
  • Index(es):
    • Date
    • Thread