首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

VxWorks特点及基本概念详解(7)

VxWorks特点及基本概念详解(7)

2.3.4 优先级反转及优先级继承

优先级反转(Priority Inversion)

优先级反转是指一个任务等待比它优先级低的任务释放资源而被阻塞,如果这时有中等优先级的就绪任务,阻塞会进一步恶化。优先级继承技术可用来解决优先级反转问题。

 

Priority Inversion Arises When A Higher-Priority Task Is Forced To Wait An Indefinite Period Of Time For A Lower-Priority Task To Complete.

优先级继承(Priority Inheritance)

优先级继承可用来解决优先级反转问题。当优先级反转发生时,优先级较低的任务被暂时地提高它的优先级,使得该任务能尽快执行,释放出优先级较高的任务所需要的资源。

Priority Inheritance



The Mutual-Exclusion Semaphore Has The Option SEM_INVERSION_SAFE, Which Enables A Priority-Inheritance Algorithm. The Priority-Inheritance Protocol Assures That A Task That Owns A Resource Executes At The Priority Of The Highest-Priority Task Blocked On That Resource. Once The Task Priority Has Been Elevated, It Remains At The Higher Level Until All Mutual-Exclusion Semaphores That The Task Owns Are Released; Then The Task Returns To Its Normal, Or Standard, Priority. Hence, The "Inheriting" Task Is Protected From Preemption By Any Intermediate-Priority Tasks. This Option Must Be Used In Conjunction With A Priority Queue (SEM_Q_PRIORITY).
返回列表