作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2007, Vol. 33 ›› Issue (08): 41-44. doi: 10.3969/j.issn.1000-3428.2007.08.014

• 博士论文 • 上一篇    下一篇

一种改进的优先级继承协议及其算法研究

王继刚1,2,顾国昌1,谢世波2,李 翌2   

  1. (1. 哈尔滨工程大学计算机科学与技术学院,哈尔滨 150001;2. 中兴通讯技术中心成都研究所,成都 610041)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2007-04-20 发布日期:2007-04-20

An Improved Priority Inheritance Protocol and Its Algorithm

WANG Jigang1, 2, GU Guochang1, XIE Shibo2, LI Yi2   

  1. (1. Computer Science and Technology Institute of Harbin Engineering University, Harbin 150001; 2. Technology Center, Chengdu Institute of ZTE Corporation, Chengdu 610041)
  • Received:1900-01-01 Revised:1900-01-01 Online:2007-04-20 Published:2007-04-20

摘要: 优先级反向是实时系统中由于任务间需要共享资源以及同步而引起的高优先级任务被低优先级任务阻塞的现象。优先级反向使得高优先级任务的执行时间无法预测,增加了实时系统的不确定性。早期的扩展协议较好地解决了优先级反转问题,但同时也存在着自身的不足。针对这些缺陷,在深入研究相关协议的基础上,该文提出了一种改进的优先级继承协议。该协议中信号量按预定义的非循环固定顺序获取,以防止死锁发生,设置超时保护机制,避免任务在获取信号量时长时间的阻塞,给出了关于该协议的分析,并在实时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