优先级继承
优先级继承是实时计算中去除优先级翻转的一种方法。进程调度算法对获取到临界资源的进程(A)增加其优先级为所有等待该资源的进程中的最高优先级。 一旦进程(A)释放了该资源,就恢复到原来的优先级。[1]
例子
考虑下例:
Job Name | Priority |
---|---|
H | High |
M | Medium |
L | Low |
假定L获取到共享资源后,H申请该资源不得而被阻塞。优先级继承协议把L的优先级升级到H的级别。M将不能抢先L因而M被阻塞。当L释放资源后,恢复到低优先级并唤醒H。H有高优先级因而抢先了L的执行权。随后M、L依次恢复执行。
参考文献
- ^ Lui Sha; Ragunathan Rajkumar & John P. Lehoczky. Priority Inheritance Protocols: An Approach to Real-Time Synchronization (PDF). IEEE Transactions on Computers. September 1990, 39 (9): 1175–1185 [2017-12-02]. doi:10.1109/12.57058. (原始内容存档 (PDF)于2016-07-29).
- "Priority Inheritance: The Real Story" by Doug Locke
- "Against Priority Inheritance" by Victor Yodaiken
- "Implementing Concurrency Control With Priority Inheritance in Real-Time CORBA (页面存档备份,存于互联网档案馆)" by Steven Wohlever, Victor Fay Wolfe and Russell Johnston
- "Priority Inheritance Spin Locks for Multiprocessor Real-Time Systems" by Cai-Dong Wang, Hiroaki Takada and Ken Sakamura
- "Hardware Support for Priority Inheritance" by Bilge E. S. Akgul, Vincent J. Mooney, Henrik Thane and Pramote Kuacharoen