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

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>
            亚洲欧美国产精品桃花| 狠狠色综合日日| 亚洲欧美电影院| 99精品国产高清一区二区| 欧美日韩视频在线一区二区观看视频| 亚洲性感激情| 亚洲国产精品久久91精品| 免费视频一区| 亚洲视频福利| 亚洲国产精品专区久久| 欧美精品亚洲二区| 久久成人免费日本黄色| 亚洲精品视频在线| 你懂的成人av| 久久精品72免费观看| 亚洲图片欧洲图片av| 亚洲国产另类精品专区| 国产精品久久久一区二区| 亚洲啪啪91| 亚洲电影网站| 国产欧美视频在线观看| 欧美日韩国产综合一区二区| 久久伊人一区二区| 99精品99久久久久久宅男| 欧美va亚洲va香蕉在线| 亚洲激情视频网站| 亚洲专区在线| 香蕉久久一区二区不卡无毒影院| 亚洲日韩第九十九页| 亚洲视频网站在线观看| 久久久女女女女999久久| 欧美诱惑福利视频| 午夜精品久久久久影视| 亚洲影院色在线观看免费| 99re6这里只有精品| 亚洲激情在线| 性欧美1819性猛交| 欧美人成免费网站| 欧美小视频在线| 欧美视频日韩视频在线观看| 欧美精品一区三区| 国产精品白丝jk黑袜喷水| 国产精品vvv| 国产专区欧美精品| 久久精品一区二区三区不卡牛牛 | 毛片一区二区| 亚洲网站啪啪| 性8sex亚洲区入口| 老牛嫩草一区二区三区日本| 欧美日韩国产天堂| 国产一区二区日韩精品| 欧美色道久久88综合亚洲精品| 国产精品一区三区| 韩日午夜在线资源一区二区| 亚久久调教视频| 久久久亚洲一区| 亚洲国产精品成人久久综合一区| 亚洲一区激情| 欧美在线三区| 一区二区三区久久精品| 亚洲欧美国产精品桃花| 狠狠色综合网| 久久人人看视频| 性欧美办公室18xxxxhd| 国产精品视频你懂的| 尤物yw午夜国产精品视频| 亚洲精品久久久久久久久久久久久 | 亚洲在线观看视频网站| 欧美午夜免费影院| 亚洲欧美日本精品| 亚洲欧美日韩电影| 好看的日韩视频| 欧美黄色aaaa| 欧美一区二区精美| 欧美日韩国产电影| 亚洲午夜精品一区二区| 久久久久久久综合| 亚洲日韩成人| 欧美日韩精品中文字幕| 亚洲一区二区三区影院| 亚洲欧美日韩成人| 永久555www成人免费| 最新成人av网站| 欧美性事在线| 久久夜色撩人精品| 亚洲天天影视| 国产三区精品| 午夜精品成人在线视频| 欧美电影免费观看高清| 老司机精品视频一区二区三区| 欧美精品三级日韩久久| 亚洲手机视频| 亚洲欧美日韩视频一区| 在线看无码的免费网站| 亚洲精品中文字幕在线| 国产精品私拍pans大尺度在线 | 久久久久一本一区二区青青蜜月| 亚洲第一天堂无码专区| 99re这里只有精品6| 国产香蕉97碰碰久久人人| 亚洲第一福利社区| 久久精品日韩欧美| 亚洲裸体视频| 亚洲国产日韩欧美一区二区三区| 欧美系列电影免费观看| 久久婷婷综合激情| 欧美国产丝袜视频| 99re8这里有精品热视频免费| 亚洲视频欧美视频| 亚洲欧洲偷拍精品| 亚洲精品视频在线| 国内自拍亚洲| 中日韩视频在线观看| 亚洲欧洲精品成人久久奇米网| 亚洲一级网站| 一区二区高清视频在线观看| 久久久久久久激情视频| 欧美一级专区免费大片| 性色av一区二区怡红| av不卡在线| 亚洲免费婷婷| 亚洲一区在线免费观看| 亚洲一区二区在线播放| 亚洲精品在线三区| 麻豆久久精品| 欧美电影在线免费观看网站| 黄色一区二区在线观看| 亚洲国产另类精品专区| 在线日本欧美| 久久综合九色99| 美女黄网久久| 欧美性生交xxxxx久久久| 亚洲高清免费视频| 亚洲高清不卡在线观看| 日韩特黄影片| 99精品视频免费观看视频| 欧美电影在线观看| 性色av一区二区三区| 欧美日韩一二三区| 一本到高清视频免费精品| 亚洲午夜国产一区99re久久| 欧美日韩免费一区二区三区视频| 最新热久久免费视频| 日韩亚洲欧美一区| 欧美日韩一区二区三区在线看| 亚洲美女视频在线观看| 亚洲一区二区免费视频| 国产精品羞羞答答| 久久精品夜色噜噜亚洲a∨| 麻豆国产精品一区二区三区 | 国产精品亚洲综合天堂夜夜 | 欧美在线视频免费| 国产又爽又黄的激情精品视频| 午夜国产精品视频| 久久久综合香蕉尹人综合网| 韩国av一区| 欧美成人日韩| 一二三四社区欧美黄| 国产自产v一区二区三区c| 久久国产精品亚洲va麻豆| 男人的天堂亚洲在线| 一区二区三区产品免费精品久久75| 欧美日韩美女在线| 校园春色国产精品| 亚洲国产二区| 亚洲欧美偷拍卡通变态| 在线观看免费视频综合| 欧美日韩大陆在线| 亚洲欧美一区二区三区久久| 欧美.www| 午夜免费日韩视频| 亚洲国产欧美一区| 国产精品理论片在线观看| 久久人人精品| 亚洲欧美日韩一区在线| 亚洲高清三级视频| 欧美一区二区在线免费观看| 亚洲国产精品视频| 国产伦精品一区二区三区免费迷| 久久在线免费观看| 亚洲影院免费| 亚洲精品一区二区三区樱花| 久久蜜臀精品av| 国产精品99久久久久久有的能看| 国内成+人亚洲| 国产精品乱子久久久久| 欧美好吊妞视频| 久久久av毛片精品| 亚洲午夜激情| 亚洲精品资源| 欧美大片免费观看| 久久精品国内一区二区三区| 在线综合视频| 国产精品系列在线播放| 欧美大胆成人| 久久精品视频在线播放| 亚洲香蕉网站| 亚洲免费观看高清在线观看 | 正在播放亚洲一区| 亚洲电影一级黄|