Subject: Re: For your edification...
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Monroe Williams <monroe@pobox.com>
List: port-macppc
Date: 02/14/2003 11:52:32
on 2/14/03 9:10 AM, Jason R Thorpe at thorpej@wasabisystems.com wrote:

> On Thu, Feb 13, 2003 at 02:31:19PM -0800, Cliff Neighbors wrote:
> 
>> this won't work unless all access to `ipending' also use lwarx/stwcx
>> otherwise you will not detect and avoid the race.
> 
> Uh, normal stores don't reset the "locked" memory location??  Wow, that
> seems ... useless!

I guess this works as long as all code is consistent about accessing
semaphores, and it probably makes for a more efficient implementation (the
store logic doesn't always need to check for reservations), but it's still
non-obvious.  Especially since stores by _other devices in the system_
(including other CPUs) WILL reset the reservation.

I'm glad I'm not the only one that finds this... surprising.  ;)

-- monroe
------------------------------------------------------------------------
Monroe Williams                                         monroe@pobox.com