摘要: 优先级反向是实时系统中由于任务间需要共享资源以及同步而引起的高优先级任务被低优先级任务阻塞的现象。优先级反向使得高优先级任务的执行时间无法预测,增加了实时系统的不确定性。早期的扩展协议较好地解决了优先级反转问题,但同时也存在着自身的不足。针对这些缺陷,在深入研究相关协议的基础上,该文提出了一种改进的优先级继承协议。该协议中信号量按预定义的非循环固定顺序获取,以防止死锁发生,设置超时保护机制,避免任务在获取信号量时长时间的阻塞,给出了关于该协议的分析,并在实时Linux上实现了基于该协议的算法。
关键词:
实时计算,
优先级反转,
优先级继承协议,
优先级上限协议
Abstract: Priority reverse is a kind of phenomenon that the higher priority task is blocked by the lower priority task since they are using the same sources in real time system. Priority reverse makes it is impossible to predict the execution time of the high priority task, and increases the indeterminacy of real time system. Although early priorities solved priority reverse, there are some limitations. To address these limitations, this paper gives rise to an improved priority inheritance protocol. In the improved protocol, the semaphores are acquired according to a fixed predetermined non-revolving sequence to avoid dead lock. Protocol establishes overtime protection mechanism to avoid prolonged block when tasks are acquiring semaphores. It analyzes the property of the protocol, on the bases of which an implementation under Linux is described. Experiment results show this protocol can perform efficiently.
Key words:
Real-time computing,
Priority reverse,
Priority inheritance protocol,
Priority ceiling protocol
王继刚;顾国昌;谢世波;李 翌. 一种改进的优先级继承协议及其算法研究[J]. 计算机工程, 2007, 33(08): 41-44.
WANG Jigang; ; GU Guochang; XIE Shibo; LI Yi. An Improved Priority Inheritance Protocol and Its Algorithm[J]. Computer Engineering, 2007, 33(08): 41-44.