【问题标题】:Meaning of "slice" in the context of mutual exclusion problems互斥问题中“切片”的含义
【发布时间】:2013-03-07 01:56:29
【问题描述】:

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

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

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

谢谢。

【问题讨论】:

    标签: concurrency operating-system mutual-exclusion


    【解决方案1】:

    从上下文来看,我认为这意味着上下文切换(即当前点有一个 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
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多