1.优先级继承协议(PIP):
优先级继承协议(PIP)是一种关键资源共享协议,用于在不同任务之间共享关键资源。这允许在不同资源之间共享关键资源,而不会发生无限优先级倒置。当任务进行优先级反转时,具有优先级资源的低优先级任务的优先级会通过优先级继承机制增加。它允许此任务尽早使用关键资源,而无需进行抢占。它避免了无限优先级倒置。
2.优先天花板协议(PCP):
优先天花板协议(PCP)是优先继承协议(PIP)和最高储物柜协议(HLP)的扩展。它解决了优先级继承协议的无限优先级倒换,最高锁定者协议的死锁和链阻塞的问题,并最大程度地减少了与继承相关的反转,这也是最高锁定者协议的局限性。它不是像优先级继承协议这样的贪婪方法。在PCP中,尽管资源是空闲的,但是可能会拒绝访问任务。
PIP和PCP之间的区别:
PRIORITY INHERITANCE PROTOCOL | PRIORITY CEILING 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 and HLP. |
It overcomes the limitations of traditional resource sharing techniques. | It overcomes the limitations of PIP and HLP. |
It requires minimum support from the operating system. | While it requires maximum 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 PCP can not suffer from chain blocking. |
It is the simplest protocol among all resource sharing protocols. | While it is the complex and most efficient one among all. |
It can not minimize the inheritance-related inversions. | While it is able to minimize the inheritance-related inversions. |
It solves the problem of unbounded priority inversion. | While it solves the problem of unbounded priority inversion, deadlock and chain blocking. |
In PIP, 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 mostly used in small applications. | While it is used in large applications. |