1

以下语句中的“切片”是什么意思:

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

作者试图表明该程序不满足互斥锁。它来自http://www.mcs.csueastbay.edu/~billard/os/mutex.txt

谢谢。

4

1 回答 1

0

从上下文来看,我认为这意味着上下文切换(即当前点存在时间片边界)。因此,

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

方法

p0 tests lock
timeslice ends -- context switch to p1
p1 tests lock
...
于 2013-03-07T02:01:56.323 回答