On 04/09/2014 22:11, Markus Fröschle wrote:
TAS makes sense in a multi-process (not necessarily multi-processor) environment. Since it does an atomic read and write within one instruction and thus can’t be interrupted, it’s ideal for task synchronisation (read a lock and set it, if free -> semaphore).
Indeed, but BSET does the same, without that read-modify-write mess at bus level!
BSET sets a bit... but returns the old value in the Z flag!So it reads value and also modifies it, in a single non-interruptible instruction. Still valid for a semaphore on a single-processor environment.
-- Vincent Rivière