亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? real-time experiment #7 priority inversion.htm

?? 該文檔是學習在Vxworks上進行編程開發的入門教材。
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0076)http://www.rt.db.erau.edu/experiments/vx/priorityInversion/Experiment-7.html -->
<HTML><HEAD><TITLE>Real-Time Experiment #7: Priority Inversion</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<CENTER>
<H1>Embry-Riddle Real-Time Laboratory Experiment<BR>Experiment #7<BR>Priority 
Inversion </H1></CENTER>
<HR SIZE=3>

<H2>Introduction</H2>Priority inversion occurs when a higher-priority task is 
forced to wait an indefinite period for the completion of a lower priority task. 
For example, <B>prioHigh, prioMedium,and prioLow</B> are task of high, medium, 
and low priority, respectively. <B>prioLow</B> has acquired a resource by taking 
its associated binary semaphore. When <B>prioHigh</B> preempts <B>prioLow</B> 
and contends for the resource by taking the same semaphore, it becomes blocked. 
If <B>prioHigh</B> would be blocked no longer than the time it normally takes 
<B>prioLow</B> to finish with the resource, there would be no problem, because 
the resource can't be preempted. However, the low priority task is vulnerable to 
preemption by the medium priority task, <B>prioMedium</B>, which could prevent 
<B>prioLow</B> from relinquishing the resource. This condition could persist, 
blocking <B>prioHigh</B> for an extensive period of time.
<P></P>
<HR SIZE=3>

<H2>Objectives</H2>The following are the primary objectives of this experiment: 
<UL>
  <LI>To demonstrate VxWorks' priority inversion avoidance mechanisms. </LI></UL>
<P></P>
<HR SIZE=3>

<H2>Description</H2>To address the problem of priority inversion, VxWorks 
provides an additional option when using mutual exclusion semaphores. This 
option is <B>SEM_INVERSION_SAFE</B> which enables a priority inheritance 
algorithm. This algorithm insures that the task that owns a resource executes at 
the priority of the highest priority task blocked on that resource. When 
execution is complete, the task relinquishes the resource and returns to its 
normal priority. Therefore, the inheriting task is protected from preemption by 
an intermediate priority task. This option must be used in conjunction with 
<B>SEM_Q_PRIORITY</B>:
<P></P><B>semId = semMCreate(SEM_Q_PRIORITY | SEM_INVERSION_SAFE);</B>
<P></P><B>1. Example: </B>
<P></P>The example below illustrates a typical situation in which priority 
inversion takes place. Here is the what happens: 
<P></P>1. <B>prioLow</B> task locks the semaphore.
<P></P>2. <B>prioLow</B> task gets preempted by <B>prioMedium</B> task which 
runs for a long time which results in the blocking of <B>prioLow</B>.
<P></P>3. <B>prioHigh</B> task preempts <B>prioMedium</B> task and tries to lock 
the semaphore which is currently locked by <B>prioLow</B>. 
<P></P>The situation is shown in the printout from running the program:
<P></P><PRE>------------------------------------------------------------------------------------
Low priority task locks semaphore
Medium task running
High priority task trys to lock semaphore
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
------------------------------------------Medium priority task exited
Low priority task unlocks semaphore
High priority task locks semaphore
High priority task unlocks semaphore
High priority task trys to lock semaphore
High priority task locks semaphore
High priority task unlocks semaphore
High priority task trys to lock semaphore
High priority task locks semaphore
High priority task unlocks semaphore
..........................................High priority task exited
Low priority task locks semaphore
Low priority task unlocks semaphore
Low priority task locks semaphore
Low priority task unlocks semaphore
..........................................Low priority task exited
 
------------------------------------------------------------------------------------
</PRE>
<P></P>Since both <B>prioLow</B> and <B>prioHigh</B> are both blocked, 
<B>prioMedium</B> runs to completion(a very long time). By the time 
<B>prioHigh</B> runs it is likely that it has missed its timing requirements.
<P></P>Here is what the code looks like:
<P></P><PRE>------------------------------------------------------------------------------------
/* includes */
#include "vxWorks.h"
#include "taskLib.h"
#include "semLib.h"

/* function prototypes */
void prioHigh(void);
void prioMedium(void);
void prioLow(void);

/* globals */
#define ITER 3
#define HIGH 102 /* high priority */
#define MEDIUM 103 /* medium priority */
#define LOW 104 /* low priority */
#define LONG_TIME 3000000
SEM_ID semMutex;


void inversion(void) /* function to create the three tasks */
{
int i, low, medium, high;
printf("\n\n....................##RUNNING##.........................\n\n\n");

/* create semaphore */
semMutex = semMCreate(SEM_Q_PRIORITY); /* priority based semaphore */

/* spawn the three tasks */
if((low = taskSpawn("task1",LOW,0x100,20000,(FUNCPTR)prioLow,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn prioHigh failed\n");
if((medium = taskSpawn("task2",MEDIUM,0x100,20000,(FUNCPTR)prioMedium,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn prioMedium failed\n");
if((high = taskSpawn("task3",HIGH,0x100,20000,(FUNCPTR)prioHigh,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn prioLow failed\n");
}

void prioLow(void) 
{
int i,j;
for (i=0; i &lt; ITER; i++)
	{
	semTake(semMutex,WAIT_FOREVER); /* wait indefinitely for semaphore */
	printf("Low priority task locks semaphore\n");
	for (j=0; j &lt; LONG_TIME; j++);
	printf("Low priority task unlocks semaphore\n");
	semGive(semMutex); /* give up semaphore */
	}
printf("..........................................Low priority task exited\n");
}

void prioMedium(void) 
{
int i;
taskDelay(20);/* allow time for task with the lowest priority to seize semaphore */
for (i=0; i &lt; LONG_TIME*10; i++)
	{
	if ((i % LONG_TIME) == 0)
		printf("Medium task running\n");
	}
printf("------------------------------------------Medium priority task exited\n");
}

void prioHigh(void) 
{
int i,j;
taskDelay(30);/* allow time for task with the lowest priority to seize semaphore */
for (i=0; i &lt; ITER; i++)
	{
	printf("High priority task trys to lock semaphore\n");
	semTake(semMutex,WAIT_FOREVER); /* wait indefinitely for semaphore */
	printf("High priority task locks semaphore\n");	
	for (j=0; j &lt; LONG_TIME; j++);
	printf("High priority task unlocks semaphore\n");	
	semGive(semMutex); /* give up semaphore */
	}
printf("..........................................High priority task exited\n");
}
------------------------------------------------------------------------------------
</PRE>
<P></P>
<HR SIZE=3>

<H2>Procedures</H2>1. Copy the source code in the example and compile it. 
<P></P>2. Load the object file onto the target machine.
<P></P>3. Run the examples by executing the main routine("inversion") of the 
example on WindSh terminal. 
<P></P>Note: Make sure you have redirected I/O, otherwise you won't see the 
results of the <EM>printf()</EM> commands. 
<HR SIZE=3>

<H2>Follow On Experiment</H2>Experiment 1. Modify the program so that the 
problem with priority inversion is eliminated and the printout from the program 
looks like the following:
<P></P><PRE>Low priority task locks semaphore
Medium task running
High priority task trys to lock semaphore
Low priority task unlocks semaphore
High priority task locks semaphore
High priority task unlocks semaphore
High priority task trys to lock semaphore
High priority task locks semaphore
High priority task unlocks semaphore
High priority task trys to lock semaphore
High priority task locks semaphore
High priority task unlocks semaphore
..........................................High priority task exited
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
Medium task running
------------------------------------------Medium priority task exited
Low priority task locks semaphore
Low priority task unlocks semaphore
Low priority task locks semaphore
Low priority task unlocks semaphore
..........................................Low priority task exited

</PRE>
<P></P>
<HR SIZE=3>

<H2>Additional Information</H2>Refer to VxWorks User's Manual and Reference 
Manual.
<P></P>
<HR SIZE=3>

<CENTER>
<H4><A 
href="http://www.rt.db.erau.edu/experiments/vx/toc/TableOfContents.html">Return 
to Primary Table of Contents </A></H4></CENTER>
<HR SIZE=3>

<CENTER>Last Updated: 26 March 1997<BR><EM>Created by: Dan Eyassu</EM><BR><A 
href="mailto:eyassud@db.erau.edu">eyassud@db.erau.edu</A><BR></CENTER></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区视频| 91官网在线观看| 久久精品国产99国产| 亚洲精品福利视频网站| 欧美激情一区不卡| 久久综合丝袜日本网| 精品处破学生在线二十三| 久久这里只精品最新地址| 2017欧美狠狠色| 国产精品麻豆网站| 一区二区三区在线视频免费 | 久久久久88色偷偷免费| 久久久精品tv| 亚洲日本免费电影| 性做久久久久久| 久草这里只有精品视频| 成人18视频在线播放| 欧美精品亚洲二区| 国产精品免费视频网站| 偷拍自拍另类欧美| 国产成人免费视频网站| 欧美中文字幕一区二区三区亚洲| 日本高清不卡视频| 精品国产一区二区三区不卡 | 麻豆国产欧美日韩综合精品二区| 日本三级亚洲精品| 国产剧情av麻豆香蕉精品| 色94色欧美sute亚洲线路一久| 日韩精品一区二| 亚洲精品大片www| 成人午夜短视频| 久久亚洲一级片| 久久97超碰色| 日韩视频一区二区在线观看| 亚洲美女淫视频| 91污在线观看| 亚洲免费电影在线| av福利精品导航| 中文字幕av一区二区三区高| 国产永久精品大片wwwapp| 欧美电影在线免费观看| 亚洲福利电影网| 欧美日韩亚洲国产综合| 一个色综合网站| 欧美日韩午夜在线视频| 一区二区三区**美女毛片| 色综合咪咪久久| 亚洲一区欧美一区| 欧美午夜在线观看| 日本va欧美va欧美va精品| 欧美成人精品1314www| 久久疯狂做爰流白浆xx| 国产精品另类一区| 欧美激情资源网| 亚洲激情在线播放| 91麻豆精品国产自产在线观看一区| 亚洲综合清纯丝袜自拍| 欧美日韩成人综合天天影院| 日韩成人一区二区三区在线观看| 日韩欧美自拍偷拍| 成人免费视频一区| 亚洲成a人片在线观看中文| 337p亚洲精品色噜噜狠狠| 国产一区二区在线免费观看| 国产三级欧美三级日产三级99| av一区二区三区在线| 日韩专区欧美专区| 国产欧美日韩精品a在线观看| 欧美午夜精品理论片a级按摩| 捆绑紧缚一区二区三区视频| 国产精品色一区二区三区| 91视视频在线观看入口直接观看www| 亚洲高清三级视频| 中文字幕佐山爱一区二区免费| 欧美一区二区啪啪| 7777精品久久久大香线蕉| 91网站在线播放| 国产在线精品视频| 美女视频一区二区三区| 亚洲欧美日韩系列| 国产精品伦理在线| 日本一区二区三区久久久久久久久不 | 亚洲成人你懂的| 综合激情网...| 国产精品大尺度| 国产精品免费人成网站| 欧美精品一区二区蜜臀亚洲| 欧美电影在线免费观看| 欧美一区二区视频免费观看| 在线不卡中文字幕| 欧美一区二区在线播放| 91精品国产入口| 日韩午夜在线播放| 26uuu精品一区二区三区四区在线| 欧美一级免费大片| 精品国产在天天线2019| 国产色爱av资源综合区| 1区2区3区精品视频| 亚洲一区二区三区四区不卡| 午夜精品久久久久久久久久久 | 欧美日韩精品电影| 日韩欧美国产三级| 中文字幕中文字幕一区二区| 一区二区三区av电影| 美女mm1313爽爽久久久蜜臀| 国产黄色精品网站| 色噜噜狠狠一区二区三区果冻| 欧美一区二区三区啪啪| 国产精品乱码人人做人人爱| 一区二区欧美精品| 韩国一区二区在线观看| 91亚洲精品乱码久久久久久蜜桃| 欧美浪妇xxxx高跟鞋交| 国产精品视频麻豆| 日韩不卡一二三区| 99re在线视频这里只有精品| 国产精品一区二区你懂的| 激情综合色丁香一区二区| 97se狠狠狠综合亚洲狠狠| 日韩一区二区在线观看| 亚洲欧美偷拍三级| 国产乱子伦视频一区二区三区| 色哟哟在线观看一区二区三区| 欧美成人官网二区| 日韩中文字幕av电影| 91色porny在线视频| 国产精品网站在线播放| 韩国v欧美v日本v亚洲v| 欧美大度的电影原声| 天天综合网 天天综合色| 91小视频免费观看| 国产精品精品国产色婷婷| 国产成人一区二区精品非洲| 欧美变态凌虐bdsm| 精东粉嫩av免费一区二区三区| 欧美亚洲国产一区二区三区va | 国产mv日韩mv欧美| 欧美国产日韩一二三区| 国产成人精品免费一区二区| 国产嫩草影院久久久久| 成熟亚洲日本毛茸茸凸凹| 亚洲欧洲美洲综合色网| 99久久99久久精品免费观看| 一区二区三区欧美久久| 欧美色综合久久| 国产精品综合在线视频| 欧美激情自拍偷拍| 欧美日高清视频| 国产一区啦啦啦在线观看| 亚洲少妇最新在线视频| 欧美男男青年gay1069videost| 日韩精品欧美精品| 欧美国产一区二区在线观看| 91丨九色丨蝌蚪丨老版| 麻豆91精品视频| 亚洲欧美色综合| 国产日产精品1区| 欧美一区二区在线播放| 一本大道久久a久久精二百| 精久久久久久久久久久| 亚洲一区在线播放| 国产精品美女久久久久久2018| 欧美亚洲国产一卡| 99精品在线免费| 国产一区二区调教| 亚洲国产精品视频| 亚洲天堂av一区| 久久久久国色av免费看影院| 欧美精品久久99久久在免费线| 波多野结衣的一区二区三区| 麻豆精品一区二区三区| 日韩精品电影一区亚洲| 一区二区在线观看免费| 最新不卡av在线| 国产精品视频在线看| 国产欧美一区二区三区沐欲| 欧美mv和日韩mv国产网站| 日韩精品一区二区三区视频在线观看| 麻豆国产欧美日韩综合精品二区| 五月综合激情婷婷六月色窝| 午夜精品久久久久久久99水蜜桃| 一卡二卡三卡日韩欧美| 亚洲亚洲人成综合网络| 亚洲一区在线观看免费观看电影高清| 亚洲欧洲国产日韩| 亚洲图片欧美综合| 亚洲国产精品一区二区www在线| 亚洲国产日韩a在线播放性色| 午夜精品123| 国产在线视视频有精品| 成人激情综合网站| 欧美自拍丝袜亚洲| 欧美日韩国产综合久久| 日韩女优视频免费观看| 欧美日韩国产不卡| 91在线一区二区| 99re这里只有精品视频首页| 欧美亚洲图片小说| 国产欧美视频在线观看| 亚洲一区二区欧美|