计算机工程

• 体系结构与软件技术 • 上一篇    下一篇

μC/OS-II任务优先级调度算法分析与改进

黄国兵,李瑞玲,李华丽,王琼   

  1. (西安工程大学计算机科学学院,西安 710048)
  • 收稿日期:2015-03-16 出版日期:2015-08-15 发布日期:2015-08-15
  • 作者简介:黄国兵(1965-),男,高级工程师、硕士,主研方向:嵌入式操作系统,电力系统自动化;李瑞玲、李华丽,硕士研究生;王琼,本科生。
  • 基金项目:
    西安市产业技术创新计划基金资助项目(CXY1347(2))。

Analysis and Improvement of μC/OS-II Task Priority Scheduling Algorithm

HUANG Guobing,LI Ruiling,LI Huali,WANG Qiong   

  1. (College of Computer Science,Xi’an Polytechnic University,Xi’an 710048,China)
  • Received:2015-03-16 Online:2015-08-15 Published:2015-08-15

摘要: μC/OS-II任务优先级调度算法通过OSUnMapTbl逆映射表直接查表获得当前就绪任务的最高优先级,因此根据μC/OS-II中就绪组和就绪表的定义,对μC/OS-II中OSUnMapTbl逆映射表的生成机理进行分析和逆向推导,得到OSUnMapTbl生成算法,采用MCS-51内部的位寻址区、位操作指令和多分支散转结构对就绪组和就绪表进行访问,改进μC/OS-II任务优先级调度算法的执行效率。在电子式油压控制器中的汇编代码运行测试结果验证了改进算法的正确性,并表明其执行效率得到大幅提高。

关键词: 嵌入式实时操作系统, 任务优先级调度算法, 逆映射表, 位操作, 就绪表

Abstract: The current highest priority in ready table is got by looking up OSUnMapTbl in μC/OS-II task scheduling algorithm. According to the definition of ready group and ready list of μC/OS-II,the generating mechanism of OSUnMapTbl in μC/OS-II is analyzed and derived inversely,and the mathematical expression of OSUnMapTbl generation is obtained. Execution efficiency of the new task scheduling algorithm is improved by accessing ready group and ready table with internal bit address area and bit operation commands as well as multi-branch case structure of MCS-51. Run test result of assembly code for improved algorithm in electronic oil pressure controller verifies the correctness of improved algorithm,and shows that its execution efficiency is improved significantly.

Key words: embedded real-time operation system, task priority scheduling algorithm, inverse mapping table, bit operation, really list

中图分类号: