begin quoting Darren New as of Thu, Apr 05, 2007 at 09:43:02AM -0700: > Stewart Stremler wrote: > >But it pretty much comes down to having an atomic comare and set > >instruction *somewhere*. > > You can actually do locking between asynchronous processes without any > atomic instructions. At least, assuming that (say) reading a memory > address while another CPU is writing it doesn't actually break the write > or read bit patterns that weren't written at all.
You need a test-and-set or equivalent. Hm. Would delays work? I don't think so... > >I wasn't trying to describe the concept, but rather the syntax I'd > >like to see. The concept is pretty old, I should think. > > It depends. Does "atomic" block out all other execution? Or does it > block out only other "atomic" blocks, in which case lots of languages > have that and it's pretty much one of the older synchronization > primitives invented. The former. "Once you start this, you will finish it, and nobody will interrupt you." -- On a single-processor machine, new timeslice, disable interrupts, run, restore. Stewart Stremler -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
