1.优先级继承协议(PIP):
优先级继承协议(PIP)是一种关键资源共享协议,用于在不同任务之间共享关键资源。这允许在不同资源之间共享关键资源,而不会发生无限优先级倒置。当任务进行优先级反转时,具有优先级资源的低优先级任务的优先级会通过优先级继承机制增加。它允许此任务尽早使用关键资源,而无需进行抢占。它避免了无限优先级倒置。
2.最高储物柜协议(HLP):
最高储物柜协议(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. |