On 4/30/07, Darren New <[EMAIL PROTECTED]> wrote:
Stewart Stremler wrote:
>> You can actually do locking between asynchronous processes without any
>> atomic instructions.
> You need a test-and-set or equivalent.
No, you actually don't. I thought you did, but you don't. As long as I
can read memory you've written to and eventually see it, it works.
The basic technique is to allocate a semi-private memory cell to each
process, and a shared one to say whose turn it is. When someone is (say)
ready for a timeslice, they set their own cell to "I'm ready." Then
whoever's turn it is is responsible to find someone who is ready and set
the shared cell to point to that process before they sleep.
Essentially, you organize things so there's only one process that can
write to any given memory address at any given time, and the identity of
that process can't be changed by more than one process.
You lost me somewhere. How is "whoever's turn it is" determined?
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg