📜  PIP和HLP的区别

📅  最后修改于: 2021-09-11 04:38:08             🧑  作者: Mango

1. 优先继承协议(PIP):
优先继承协议(PIP)是一种关键资源共享协议,用于在不同任务之间共享关键资源。这允许在不同的之间共享关键资源而不会发生无界的优先级反转。当任务发生优先级倒置时,优先级继承机制会提高具有关键资源的低优先级任务的优先级。它允许这个任务在不经过抢占的情况下尽早使用关键资源。它避免了无界的优先级倒置。

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

PIP和HLP的区别:

PRIORITY INHERITANCE PROTOCOL HIGHEST LOCKER PROTOCOL
It is a critical resource sharing protocol used for sharing critical resources among different tasks. It is a critical resource sharing protocol which is an extension of PIP.
It overcomes the limitations of traditional resource sharing techniques. It overcomes the limitations of PIP.
It requires minimum support from the operating system. While it requires moderate support from the operating system.
It can not prevent the deadlock. While it prevents tasks from going into deadlock.
Tasks using PIP may suffer chain blocking. While the tasks using HLP can not suffer from chain blocking.
It is the simplest protocol among all resource sharing protocols. While it is the moderate one among all.
Intermediate priority tasks not needing CR do not go into inheritance-related inversion. Intermediate priority tasks not needing CR do not might go into inheritance-related inversion.
It solves the problem of unbounded priority inversion. While it solves the problem of deadlock and chain blocking.
It can not make tasks to miss the corresponding deadlines. While it can cause tasks to miss the deadlines.
It is mostly used in small applications. While it is rarely used in real-life applications.