• 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
Re: Tricks to avoid mutexes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Tricks to avoid mutexes
      • From: Makira <email@hidden>
References: 
 >Tricks to avoid mutexes (From: Makira <email@hidden>)

  • Prev by Date: Re: Tricks to avoid mutexes
  • Next by Date: [OT] Re: background image in cocoa view AU
  • Previous by thread: Tricks to avoid mutexes
  • Next by thread: Re: Tricks to avoid mutexes
  • Index(es):
    • Date
    • Thread