• 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: Problem killing my threads :)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem killing my threads :)


  • Subject: Re: Problem killing my threads :)
  • From: Aram Greenman <email@hidden>
  • Date: Mon, 23 Sep 2002 11:57:55 -0700

On Monday, September 23, 2002, at 07:58 AM, email@hidden wrote:

No, a lock is not required here since you just have a write on one side and a
read on another one. Both operations will be atomic.

You should lock even around a simple assignment statement. There is no guarantee that it will be atomic since it can possibly compile to more than one operation. I'm not sure when/if this is the case on PPC, but anyway your code might have to run on a different processor someday.

I *think* the operation would always be atomic if the variable assigned to was a single-byte type (i.e. char), but I'm not sure.

Aram
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Problem killing my threads :)
      • From: Guillaume Outters <email@hidden>
References: 
 >Re: Problem killing my threads :) (From: email@hidden)

  • Prev by Date: Re: Cocoa Browser [was Re: NSMutableNumber?]
  • Next by Date: Multi user
  • Previous by thread: Re: Problem killing my threads :)
  • Next by thread: Re: Problem killing my threads :)
  • Index(es):
    • Date
    • Thread