Question

What does "slice" mean in the following statement:

p0 tests lock (now, slice before actually setting lock)

The author is trying to show mutex is not met for this program. It's from http://www.mcs.csueastbay.edu/~billard/os/mutex.txt

Thanks.

Was it helpful?

Solution

From context, I believe it means to context switch (i.e. that there is a timeslice boundary at the current point). Thus,

p0 tests lock (now, slice before actually setting lock)
p1 tests lock (this makes p1 think it is still available)

means

p0 tests lock
timeslice ends -- context switch to p1
p1 tests lock
...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top