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

Focus on ACE

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

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

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

實時操作系統的一個特點就是,一個實時任務,會在規定的時間內得到響應,并且在規定的時間內完成任務。所以,一切不可預知的動作都是有害的。

有興趣可以看看下面兩個鏈接:
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 "


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            欧美日韩岛国| 欧美激情第9页| 国产午夜精品全部视频在线播放| 亚洲午夜免费福利视频| avtt综合网| 国产精品视频导航| 欧美影片第一页| 久久精品国产第一区二区三区最新章节 | 在线视频欧美日韩| 国产精品亚洲产品| 久久久天天操| 麻豆精品国产91久久久久久| 亚洲国产美女精品久久久久∴| 国产模特精品视频久久久久| 羞羞答答国产精品www一本| 亚洲精品123区| 亚洲综合电影| 红杏aⅴ成人免费视频| 欧美电影打屁股sp| 欧美日韩午夜激情| 久久久欧美精品sm网站| 欧美电影在线播放| 亚洲女人av| 久久久国产精品一区二区中文 | 亚洲国产成人tv| 亚洲国产国产亚洲一二三| 国产精品va在线| 老司机凹凸av亚洲导航| 欧美人与性禽动交情品| 久久精品国产第一区二区三区| 免费人成精品欧美精品| 亚洲欧美日本日韩| 噜噜噜在线观看免费视频日韩| 亚洲综合视频一区| 亚洲天堂av在线免费| 一区二区在线免费观看| aa国产精品| 亚洲毛片在线观看| 欧美诱惑福利视频| 亚洲网站在线看| 蜜桃伊人久久| 久久精品国语| 国产精品美女一区二区| 亚洲欧洲日韩综合二区| 国内成人自拍视频| 午夜国产一区| 亚洲午夜精品国产| 欧美高清视频一区二区三区在线观看| 欧美在线免费视屏| 欧美三级视频在线观看| 久久久精品午夜少妇| 欧美在线不卡| 亚洲欧美影院| 国产精品久久久久av免费| 亚洲男人影院| 欧美巨乳在线| 亚洲国产福利在线| 亚洲国产日韩欧美在线动漫| 欧美在线免费观看| 久久精品一区二区| 国产欧美视频一区二区三区| 亚洲精品欧美精品| 91久久久久久久久| 久久夜色精品国产欧美乱| 久久久综合激的五月天| 国产一区二区黄色| 欧美在线视频一区二区| 久久国内精品自在自线400部| 国产精品jvid在线观看蜜臀| aa级大片欧美| 亚洲欧美在线x视频| 国产精品三上| 新片速递亚洲合集欧美合集| 欧美一区二区精品在线| 国产亚洲精品高潮| 久久精品一二三| 久久噜噜亚洲综合| 亚洲缚视频在线观看| 老牛影视一区二区三区| 亚洲国产一区二区三区青草影视| 亚洲欧洲一区二区三区久久| 蜜桃av一区| 一区二区三区高清不卡| 午夜一区不卡| 欲色影视综合吧| 欧美不卡高清| 亚洲午夜电影在线观看| 久久欧美中文字幕| 亚洲欧洲在线一区| 欧美日韩精品欧美日韩精品一 | 欧美中文字幕不卡| 狠狠久久五月精品中文字幕| 另类av一区二区| 亚洲美女诱惑| 久久激情视频免费观看| 亚洲国产精品久久久久秋霞影院| 欧美激情视频在线播放| 亚洲午夜在线视频| 欧美成人一区二区三区在线观看| 中文久久精品| 国内外成人免费激情在线视频 | 久久久久久久综合日本| 欧美国产亚洲另类动漫| 亚洲影院污污.| 黑人一区二区三区四区五区| 欧美激情综合五月色丁香小说 | 欧美成人一品| 亚久久调教视频| 亚洲国产裸拍裸体视频在线观看乱了中文 | 日韩亚洲欧美在线观看| 久久五月天婷婷| 亚洲伦理一区| 麻豆freexxxx性91精品| 亚洲性av在线| 在线精品视频免费观看| 欧美片网站免费| 久久精品视频免费| 99视频精品免费观看| 久久综合婷婷| 欧美专区在线| 亚洲深夜福利| 亚洲精品影视| 亚洲国产经典视频| 国产欧美亚洲精品| 欧美日韩美女一区二区| 久久精品成人一区二区三区 | 久久精品视频网| 中文日韩电影网站| 亚洲日本成人| 亚洲第一福利社区| 国产一区二区三区在线观看免费视频 | 欧美激情视频一区二区三区免费| 欧美在线视频一区二区| 亚洲一本大道在线| 日韩一级在线观看| 亚洲黄色成人| 在线免费观看成人网| 国产日韩欧美中文| 国产精品外国| 国产精品久久国产精品99gif | 亚洲一区亚洲| 亚洲综合日韩在线| 亚洲欧美清纯在线制服| 一本大道久久a久久精二百| 亚洲日本成人网| 亚洲片在线资源| 亚洲黄色在线看| 亚洲欧洲日韩在线| 亚洲精选视频在线| 日韩视频一区二区三区| 亚洲裸体俱乐部裸体舞表演av| 亚洲精品一区二区网址| 亚洲三级国产| 99视频精品免费观看| 亚洲视频在线观看| 亚洲欧美激情在线视频| 久久精品官网| 美女国内精品自产拍在线播放| 欧美成人国产| 欧美日韩视频免费播放| 国产精品日韩在线观看| 国产午夜精品久久久| 伊人成人在线| 亚洲精品乱码久久久久久蜜桃91 | 国产精品夜色7777狼人| 国产日韩一区欧美| 在线精品一区| 一区二区三区精品视频| 午夜日韩在线观看| 美女任你摸久久| 亚洲黄网站黄| 亚洲综合色网站| 久久久亚洲国产天美传媒修理工| 美国成人直播| 欧美性理论片在线观看片免费| 国产精品久久影院| 狠狠综合久久av一区二区小说| 亚洲欧洲另类| 欧美一区二区三区在线免费观看| 久久影音先锋| 99re热这里只有精品免费视频| 亚洲欧美一区二区三区极速播放| 久久综合伊人77777| 欧美日韩在线播放三区| 狠狠色狠狠色综合| 一本色道久久综合精品竹菊| 久久精品盗摄| 亚洲精品国产品国语在线app | 亚洲美女在线观看| 久久国产精品一区二区三区四区| 欧美黄在线观看| 国内一区二区三区| 99国内精品久久| 久久在线免费观看| 99re8这里有精品热视频免费 | 一区二区三区四区蜜桃| 开元免费观看欧美电视剧网站| 国产精品日韩欧美| 99在线精品观看| 免费视频亚洲|