Test and Set Lock (TSL) Definition
-
The test and set lock (TSL) is a hardware instruction that is provided
by the CPU.
-
int TSL(int lock); /* prototype specification of TSL */
e.g. (* Pascal pseudo language
implementation of Test and Set lock*)
function Test-and-Set(var target: boolean): boolen;
begin
Test-and-Set := target;
target := true;
end;
-
It reads the contents of the memory word into a register and then stores
a nonzero value at the memory address
-
The operations of reading and storing (i.e. writing) the memory word are
gauranteed to be indivisible (i.e. atomic)
This page is maintained by Christopher
A. Gantz (cag@cs.du.edu).