gpt4 book ai didi

operating-system - 饥饿自由与有限等待的关系

转载 作者:行者123 更新时间:2023-12-02 04:35:55 24 4
gpt4 key购买 nike

关于饥饿和有限等待之间的关系,我有四个问题。

  • 饥饿自由是否意味着死锁自由?

    我的答案:

    来自 here ,无饥饿的定义是

    Freedom from Starvation -:Every thread that attempts to acquire the lock eventually succeeds

    Freedom from Deadlock -:f some thread attempts to acquire the lock, then some thread (not necessarily the thread referred to in the if statement; emphasis added) will succeed in acquiring the lock.



    所以我可以说 饥饿自由意味着死锁自由
  • 饥饿自由是否意味着有界等待?
  • 有界等待是否意味着饥饿自由?
  • 有界等待和无死锁是否意味着无饥饿?

  • 我被困在第 2、3、4 点。

    最佳答案

    2 .饥饿自由是否意味着有界等待?
    Starvation意味着一个线程将无限期地等待。但是starvation-freedom意味着线程不会永远等待并最终获得资源。 Bounded waiting意味着允许线程进入其 critical sections 的次数是有限制的。在线程请求进入其 critical section 之后在该请求被批准之前。所以,很明显 starvation freedom暗示 bounded waiting ,否则,其他线程总是可以在 Critical section 中这与 starvation-freedom 相矛盾.

    3 .是否有界等待意味着饥饿自由?

    答案也是肯定的,因为在越过限制后,等待过程将有机会进入critical section因此,没有无限期的等待,因此,starvation-freedom .

    4 .是否有界等待和无死锁意味着无饥饿?

    从上面的解释可以清楚地看出,这也是正确的。

    关于operating-system - 饥饿自由与有限等待的关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42871471/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com