📜  HLP和PCP的区别

📅  最后修改于: 2021-09-12 11:24:53             🧑  作者: Mango

1. 最高储物柜协议(HLP):
Highest Locker Protocol (HLP) 是一种关键资源共享协议,它是优先继承协议 (PIP) 的扩展,它被引入以克服优先继承协议 (PIP) 的局限性。在这个关键资源共享协议中,每个关键资源都被分配了一个上限优先级值。此值是所有可能请求保留此关键资源的任务的最大优先级。当任务持有关键资源时,其优先级更改为关键资源的上限优先级值。如果任务拥有多个关键资源,则将所有上限优先级值中的最大值指定为任务的优先级。

2. 优先上限协议(PCP):
优先天花板协议 (PCP) 是优先继承协议 (PIP) 和最高储物柜协议 (HLP) 的扩展。解决了优先继承协议的无界优先级倒置、Highest Locker Protocol 的死锁和锁链问题,同时也最大限度地减少了Highest Locker Protocol 的局限性与继承相关的倒置。它不是像优先继承协议那样贪婪的方法。在 PCP 中,尽管资源是空闲的,但任务可能会被拒绝访问。

HLP和PCP的区别:

HIGHEST LOCKER PROTOCOL PRIORITY CEILING PROTOCOL
It is a critical resource sharing protocol which is an extension of PIP. It is a critical resource sharing protocol which is an extension of PIP and HLP.
It overcomes the limitations of PIP. It overcomes the limitations of PIP and HLP.
It requires moderate support from the operating system. While it requires maximum support from the operating system.
It is the least efficient among all resource sharing protocols. While it is the most efficient one among all resource sharing protocols.
It maximizes the inheritance-related inversions. While it is able to minimize the inheritance-related inversions.
It solves the problem of unbounded priority inversion, deadlock and chain blocking. While it solves the problem of unbounded priority inversion, deadlock, chain blocking and inheritance-related inversions.
In HLP, highest priority task can not be denied access if resource is free. While in PCP, highest priority task can be denied access although resource is free if priority value is less than CSC (Current System Ceiling).
It is rarely used in real-life applications. While it is used in large applications.