青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Focus on ACE

訂閱 ace-china
電子郵件:
瀏覽存于 groups.google.com 上的所有帖子

C++博客 首頁 新隨筆 聯(lián)系 聚合 管理
  64 Posts :: 3 Stories :: 22 Comments :: 0 Trackbacks

Priority Inversion 優(yōu)先級反轉(zhuǎn)是嵌入式實時系統(tǒng)里面的一個經(jīng)典的問題。簡單描述一下這個問題:有三個優(yōu)先級不同的task,A,B,C; A的優(yōu)先級最高,B次之,C最低。其中A和C有共享的臨界區(qū)。如果C已進入臨界區(qū),那么A在進入進入臨界區(qū)之前,就會被阻塞。task B有可能打斷C而進入運行狀態(tài),這樣C什么時候從臨界區(qū)退出,就是一個未知的時間。A只有C從臨界區(qū)退出后才能被調(diào)度,A被阻塞的時間也是未知的。這樣,低優(yōu)先級的B先于高優(yōu)先級的A被調(diào)度,優(yōu)先級發(fā)生了逆轉(zhuǎn)。
這個問題在一般的操作系統(tǒng)里面不是一個嚴重的問題,最多A被多阻塞了一段時間。但是,在實時系統(tǒng)里面,如果一個任務(wù)在規(guī)定的時間里面沒有被調(diào)度運行,系統(tǒng)就相當于失敗了,可能引發(fā)系統(tǒng)崩潰。
解決這個問題有兩種手段:
1:Priority inheritance(優(yōu)先級繼承),如果一個高優(yōu)先級的task被阻塞,與它共享臨界區(qū)的低優(yōu)先級的task在進入臨界區(qū)后,優(yōu)先級就會繼承高優(yōu)先級task的優(yōu)先級,保證它不會被其他優(yōu)先級次高的任務(wù)打斷。從臨界區(qū)退出后,C的優(yōu)先級恢復(fù)正常。
2:A priority ceiling(最高優(yōu)先級),給臨界區(qū)分配最高優(yōu)先級,如果一個task進入臨界區(qū),就把臨界區(qū)的優(yōu)先級賦給它,已保證它不會被打斷。從臨界區(qū)退出后,task的優(yōu)先級恢復(fù)正常。

實時操作系統(tǒng)的一個特點就是,一個實時任務(wù),會在規(guī)定的時間內(nèi)得到響應(yīng),并且在規(guī)定的時間內(nèi)完成任務(wù)。所以,一切不可預(yù)知的動作都是有害的。

有興趣可以看看下面兩個鏈接:
http://en.wikipedia.org/wiki/Priority_inversion

 

Priority inversion

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In scheduling, priority inversion is the scenario where a low priority task holds a shared resource that is required by a high priority task. This causes the execution of the high priority task to be blocked until the low priority task has released the resource, effectively "inverting" the relative priorities of the two tasks. If some other medium priority task, one that does not depend on the shared resource, attempts to run in the interim, it will take precedence over both the low priority task and the high priority task.

In some cases, priority inversion can occur without causing immediate harm—the delayed execution of the high priority task goes unnoticed, and eventually the low priority task releases the shared resource. However, there are also many situations in which priority inversion can cause serious problems. If the high priority task is left starved of the resources, it might lead to a system malfunction or the triggering of pre-defined corrective measures, such as a watch dog timer resetting the entire system. The trouble experienced by the Mars lander "Mars Pathfinder"[1][2] is a classic example of problems caused by priority inversion in realtime systems.

Priority inversion can also reduce the perceived performance of the system. Low priority tasks usually have a low priority because it is not important for them to finish promptly (for example, they might be a batch job or another non-interactive activity). Similarly, a high priority task has a high priority because it is more likely to be subject to strict time constraints—it may be providing data to an interactive user, or acting subject to realtime response guarantees. Because priority inversion results in the execution of the low priority task blocking the high priority task, it can lead to reduced system responsiveness, or even the violation of response time guarantees.

A similar problem called deadline interchange can occur within Earliest Deadline First Scheduling (EDF).

Contents

[hide]

[edit] Solutions

The existence of this problem has been known since the 1970s, but there is no fool-proof method to predict the situation. There are however many existing solutions, of which the most common ones are:

Disabling all interrupts to protect critical sections
When disabled interrupts are used to prevent priority inversion, there are only two priorities: preemptible, and interrupts disabled. With no third priority, inversion is impossible. Since there's only one piece of lock data (the interrupt-enable bit), misordering locking is impossible, and so deadlocks cannot occur. Since the critical regions always run to completion, hangs do not occur. Note that this only works if all interrupts are disabled. If only a particular hardware device's interrupt is disabled, priority inversion is reintroduced by the hardware's prioritization of interrupts. A simple variation, "single shared-flag locking" is used on some systems with multiple CPUs. This scheme provides a single flag in shared memory that is used by all CPUs to lock all inter-processor critical sections with a busy-wait. Interprocessor communications are expensive and slow on most multiple CPU systems. Therefore, most such systems are designed to minimize shared resources. As a result, this scheme actually works well on many practical systems. These methods are widely used in simple embedded systems, where they are prized for their reliability, simplicity and low resource use. These schemes also require clever programming to keep the critical sections very brief, under 100 microseconds in practical systems. Many software engineers consider them impractical in general-purpose computers.
Arguably, these methods are similar to priority ceilings.
A priority ceiling
With priority ceilings, the shared mutex process (that runs the operating system code) has a characteristic (high) priority of its own, which is assigned to the task locking the mutex. This works well, provided the other high priority task(s) that try to access the mutex does not have a priority higher than the ceiling priority.
Priority inheritance
Under the policy of priority inheritance, whenever a high priority task has to wait for some resource shared with an executing low priority task, the low priority task is assigned the priority of the highest waiting priority task for the duration of its own use of the shared resource, thus keeping medium priority tasks from pre-empting the (originally) low priority task, and thereby effectively the waiting high priority task as well.

[edit] See also

[edit] Notes

  1. ^ What Really Happened on Mars by Glenn Reeves of the JPL Pathfinder team
  2. ^ Explanation of priority inversion problem experienced by Mars Pathfinder

[edit] References

  • by Butler W. Lampson and David D. Redell, CACM 23(2):105-117 (Feb 1980) - One of the first (if not the) first papers to point out the priority inversion problem. Also suggested disabling interrupts and the priority ceiling protocol as solutions, noting that the former of these two cannot not tolerate page faults while in use.

[edit] External links

Retrieved from "


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            在线视频精品一区| 亚洲日本一区二区| 欧美高清免费| 欧美国产亚洲精品久久久8v| 久久亚洲私人国产精品va媚药| 久久精品国产999大香线蕉| 久久精品中文| 久久手机免费观看| 欧美国产日本在线| 国产精品福利网站| 国产真实乱子伦精品视频| 亚洲承认在线| 亚洲一区国产精品| 欧美夜福利tv在线| 另类激情亚洲| 亚洲精品一区二区在线观看| 亚洲图片你懂的| 久久aⅴ乱码一区二区三区| 麻豆精品精华液| 欧美国产精品v| 国产精品私拍pans大尺度在线 | 亚洲一区中文| 久久九九热re6这里有精品| 葵司免费一区二区三区四区五区| 欧美激情一区二区三区蜜桃视频| 一区二区三区欧美在线| 久久久精品国产免费观看同学 | 午夜激情综合网| 99re6热在线精品视频播放速度 | 欧美日韩亚洲天堂| 亚洲最新在线视频| 欧美亚洲综合在线| 男人插女人欧美| 亚洲午夜久久久久久尤物 | 欧美日韩成人在线| 国产欧美一区二区精品仙草咪 | 国产精品美女久久久久久2018| 国产一区二区激情| 欧美专区在线| 亚洲精品国产精品乱码不99| av72成人在线| 久久综合电影一区| 国产日韩在线看片| 久久精品人人做人人爽电影蜜月| 欧美日韩免费一区二区三区视频| 国产有码一区二区| 亚洲欧美日韩精品久久久| 欧美成人一区二区三区| 午夜亚洲福利| 国产精品成人免费| 亚洲视频一区二区免费在线观看| 女女同性精品视频| 午夜视频在线观看一区二区三区| 欧美视频免费在线| 99热免费精品| 亚洲国产成人91精品| 久久久久久9| 国产日本欧美一区二区| 午夜宅男久久久| 一区二区三区蜜桃网| 一本久久综合亚洲鲁鲁| 欧美另类99xxxxx| 亚洲黄色精品| 欧美高清免费| 欧美.com| 亚洲国产精品成人一区二区| 久久久综合激的五月天| 亚洲欧美国产另类| 国产精品永久免费| 久久激情视频免费观看| 性欧美大战久久久久久久久| 国产女人精品视频| 欧美在线播放一区二区| 亚洲女人av| 好吊妞**欧美| 欧美成人69| 欧美精品国产精品日韩精品| 一个色综合导航| 一区二区不卡在线视频 午夜欧美不卡在 | 国产日韩欧美黄色| 亚洲一区二区四区| 99热这里只有成人精品国产| 欧美日韩在线视频观看| 亚洲中字黄色| 新狼窝色av性久久久久久| 激情av一区| 亚洲精品久久久蜜桃| 国产精品久久久久久av下载红粉 | 亚洲伦理自拍| 日韩视频免费在线观看| 午夜精品久久久久久99热软件| 99精品福利视频| 国产欧美一区二区精品性| 久久字幕精品一区| 女主播福利一区| 亚洲免费视频观看| 久久久久九九视频| 国产精品99久久久久久久女警| 亚洲欧美日韩区| 亚洲欧洲日本mm| 亚洲欧美日韩在线综合| 亚洲国产欧美一区二区三区同亚洲| 日韩亚洲视频在线| 韩国成人福利片在线播放| 亚洲国产精品成人一区二区| 国产精品久久久久9999吃药| 欧美激情精品久久久| 国产欧美日韩伦理| 亚洲欧洲在线一区| 国内精品免费在线观看| 在线天堂一区av电影| 亚洲国产成人在线播放| 午夜一区不卡| 亚洲一区在线播放| 老色鬼久久亚洲一区二区| 欧美一区二区三区视频在线观看| 欧美xx69| 美女爽到呻吟久久久久| 欧美特黄一级大片| 欧美成人精品一区| 国产欧美亚洲日本| 一二三区精品福利视频| 亚洲人成啪啪网站| 久久免费视频在线观看| 欧美亚洲一区二区在线观看| 欧美日韩精品欧美日韩精品| 亚洲高清av在线| 一区在线免费| 久久精品免费| 久久嫩草精品久久久精品| 国产乱码精品一区二区三区av| 91久久国产综合久久| 久久国产精品99国产| 欧美日韩dvd在线观看| 欧美国产大片| 亚洲国产网站| 免费亚洲婷婷| 欧美成人免费小视频| 激情亚洲一区二区三区四区| 欧美在线一级视频| 久久国产黑丝| 一区精品在线播放| 久久久欧美一区二区| 开心色5月久久精品| 狠狠色伊人亚洲综合网站色| 久久高清一区| 美女亚洲精品| 亚洲日本电影在线| 欧美激情中文字幕乱码免费| 日韩亚洲综合在线| 性欧美暴力猛交69hd| 国产色爱av资源综合区| 久久精品亚洲一区二区三区浴池 | 欧美国产在线观看| 亚洲欧洲另类国产综合| 欧美欧美午夜aⅴ在线观看| 日韩视频免费在线观看| 欧美一二三区精品| 伊人狠狠色丁香综合尤物| 免费一级欧美片在线播放| 亚洲美女中出| 久久激情一区| 亚洲精品国产精品国自产观看| 欧美日韩国产综合视频在线| 亚洲欧美国产三级| 性久久久久久久久久久久| 欧美日韩中文字幕精品| 亚洲精品乱码久久久久久久久| 亚洲一区二区在线免费观看视频| 国产女主播一区二区三区| 久久嫩草精品久久久精品| 亚洲精品一区中文| 欧美资源在线| 亚洲人线精品午夜| 国产欧美在线视频| 欧美成人伊人久久综合网| 亚洲永久免费视频| 欧美国产1区2区| 欧美一区免费| 夜夜狂射影院欧美极品| 国产综合久久| 欧美日韩免费高清| 久久久夜精品| 亚洲午夜视频在线观看| 欧美成人一区二区| 久久国产视频网| 亚洲性线免费观看视频成熟| 亚洲国产精品久久久久| 国产九区一区在线| 欧美精品黄色| 美玉足脚交一区二区三区图片| 亚洲曰本av电影| 亚洲人成人99网站| 免费视频久久| 久久久久久久波多野高潮日日 | 欧美午夜剧场| 美女91精品| 久久综合色综合88| 久久国产欧美日韩精品| 国产精品嫩草影院一区二区|