質問

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.

役に立ちましたか?

解決

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
...
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top