Re: Problem killing my threads :)
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.