互斥问题背景下“切片”的意义

时间:2013-03-07 01:56:30

标签: concurrency operating-system mutual-exclusion

“切片”在以下陈述中的含义是什么:

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

作者试图显示此程序未满足互斥锁。 它来自http://www.mcs.csueastbay.edu/~billard/os/mutex.txt

感谢。

1 个答案:

答案 0 :(得分:0)

从上下文来看,我认为它意味着上下文切换(即当前点有 timeslice 边界)。因此,

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
...