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

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已進(jìn)入臨界區(qū),那么A在進(jìn)入進(jìn)入臨界區(qū)之前,就會被阻塞。task B有可能打斷C而進(jìn)入運行狀態(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)里面不是一個嚴(yán)重的問題,最多A被多阻塞了一段時間。但是,在實時系統(tǒng)里面,如果一個任務(wù)在規(guī)定的時間里面沒有被調(diào)度運行,系統(tǒng)就相當(dāng)于失敗了,可能引發(fā)系統(tǒng)崩潰。
解決這個問題有兩種手段:
1:Priority inheritance(優(yōu)先級繼承),如果一個高優(yōu)先級的task被阻塞,與它共享臨界區(qū)的低優(yōu)先級的task在進(jìn)入臨界區(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進(jìn)入臨界區(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>
            久久精品在线视频| 亚洲一区二区在线免费观看| 亚洲欧美日韩精品久久久久| 欧美丝袜第一区| 亚洲一区二区三区四区在线观看| 日韩亚洲成人av在线| 国产精品久久久久免费a∨大胸 | 国产亚洲成av人片在线观看桃| 久久av一区二区三区亚洲| 久久福利一区| 亚洲精品国产精品乱码不99按摩| 91久久国产综合久久91精品网站| 欧美精品免费视频| 欧美在线免费播放| 男人的天堂亚洲| 亚洲综合999| 久久国产精品一区二区三区| 亚洲精品中文字幕在线| 亚洲一区bb| 亚洲人成免费| 小黄鸭精品aⅴ导航网站入口| 精东粉嫩av免费一区二区三区| 亚洲高清资源| 国产色视频一区| 亚洲国产日本| 国产一区二区三区av电影| 欧美激情一区三区| 国产欧美精品xxxx另类| 亚洲激情一区| 国内综合精品午夜久久资源| 日韩视频免费观看高清完整版| 国产一区二区三区的电影| 亚洲日产国产精品| 亚洲电影免费观看高清完整版在线观看 | 91久久在线播放| 国产一区二区三区黄视频| 国产精品乱码一区二区三区| 免费看精品久久片| 国产精品综合久久久| 亚洲啪啪91| 亚洲国产二区| 久久精品理论片| 欧美一级视频精品观看| 欧美日韩国产美| 亚洲高清影视| 在线观看日产精品| 久久精品二区三区| 久久久久成人精品免费播放动漫| 亚洲人成网站影音先锋播放| 狠久久av成人天堂| 欧美在线亚洲| 久久久国产精品亚洲一区| 国产精品国产三级国产| 亚洲精品在线免费| 日韩一级大片在线| 欧美顶级艳妇交换群宴| 亚洲精选久久| 嫩草成人www欧美| 欧美大片第1页| 亚洲韩国精品一区| 麻豆国产精品777777在线| 久热精品在线| 亚洲大胆人体视频| 免费欧美高清视频| 亚洲三级视频在线观看| 亚洲精品在线二区| 欧美久久视频| 在线亚洲电影| 欧美亚洲日本网站| 国产一区二区三区视频在线观看| 午夜国产一区| 麻豆精品网站| 亚洲精品乱码久久久久久蜜桃91 | 亚洲免费不卡| 亚洲欧美日韩另类| 国产亚洲精品v| 久久久久久亚洲综合影院红桃| 米奇777超碰欧美日韩亚洲| 亚洲成人在线免费| 欧美精品一区二区久久婷婷| 亚洲免费高清| 久久精品日韩欧美| 在线视频观看日韩| 欧美日韩国产综合久久| 亚洲无人区一区| 久久中文欧美| 99精品欧美一区| 国产精品一二一区| 蜜桃精品一区二区三区| 99在线|亚洲一区二区| 欧美在线网站| 亚洲精品影院在线观看| 国产精品乱码人人做人人爱| 久久亚洲国产成人| 一区二区91| 欧美刺激午夜性久久久久久久| 亚洲视频免费在线| 欧美久久久久久| 性欧美1819性猛交| 亚洲精品国久久99热| 久久久久久久一区二区| 日韩亚洲精品视频| 在线看不卡av| 国产精品一区二区在线观看不卡| 麻豆成人小视频| 性高湖久久久久久久久| 亚洲精品激情| 免费亚洲一区二区| 午夜在线一区| 在线视频精品一区| 亚洲国产精品成人一区二区| 国产精品手机在线| 欧美日韩国产综合久久| 美玉足脚交一区二区三区图片| 亚洲一区二区在线播放| 亚洲精品一二区| 亚洲国产cao| 嫩模写真一区二区三区三州| 久久国产色av| 香蕉精品999视频一区二区| 亚洲最快最全在线视频| 亚洲国产欧美另类丝袜| 一区二区三区在线观看视频| 国产精品一二三| 国产精品国产三级国产aⅴ浪潮| 欧美jjzz| 欧美成人中文| 牛人盗摄一区二区三区视频| 久久久国产一区二区| 欧美在线|欧美| 欧美一级黄色录像| 亚洲男人的天堂在线| 国产精品99久久久久久有的能看| 亚洲日本中文字幕| 亚洲精品社区| 亚洲精品亚洲人成人网| 亚洲人体一区| 亚洲剧情一区二区| 一本色道久久综合亚洲精品高清| 亚洲日韩欧美视频| 日韩小视频在线观看专区| 日韩网站在线看片你懂的| 亚洲日本乱码在线观看| 一本色道久久88综合亚洲精品ⅰ| 亚洲精品人人| 一本久久青青| 亚洲免费在线电影| 性色av香蕉一区二区| 久久久久九九九九| 欧美成熟视频| 欧美婷婷六月丁香综合色| 国产精品第一页第二页第三页| 国产精品久久久久aaaa九色| 国产精品爽爽ⅴa在线观看| 国产一区二区三区无遮挡| 狠狠久久婷婷| 亚洲精品视频一区| 亚洲免费在线| 久热精品视频在线观看一区| 欧美韩国日本综合| 99精品欧美一区二区蜜桃免费| 亚洲一二三区精品| 久久久久久亚洲精品中文字幕| 欧美国产日韩在线| 国产精品乱码一区二区三区 | 欧美日韩亚洲激情| 国产女人18毛片水18精品| 亚洲国产欧美不卡在线观看| 国产精品99久久久久久久vr | 亚洲一品av免费观看| 久久久精彩视频| 亚洲福利在线观看| 亚洲小少妇裸体bbw| 玖玖国产精品视频| 欧美性视频网站| 亚洲国产欧美一区二区三区丁香婷| 一区二区三区国产精华| 久久久噜噜噜久久人人看| 亚洲青涩在线| 久久激情五月丁香伊人| 欧美日韩国产在线看| 一区三区视频| 亚洲自拍啪啪| 亚洲国产裸拍裸体视频在线观看乱了中文 | 国产三级精品在线不卡| 亚洲人成在线观看一区二区| 午夜久久资源| 91久久久在线| 久久嫩草精品久久久精品一| 国产精品美女www爽爽爽视频| 亚洲国产aⅴ天堂久久| 久久国产精彩视频| av成人老司机| 欧美国产在线电影| 黄色成人av在线| 欧美在线综合| 亚洲一品av免费观看| 欧美日韩国产探花| 亚洲卡通欧美制服中文| 欧美成人黄色小视频|