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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? real-time experiment #5 task scheduling.htm

?? 該文檔是學(xué)習(xí)在Vxworks上進(jìn)行編程開發(fā)的入門教材。
?? HTM
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0071)http://www.rt.db.erau.edu/experiments/vx/rrScheduling/Experiment-5.html -->
<HTML><HEAD><TITLE>Real-Time Experiment #5: Task Scheduling</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 #5<BR>Round-Robin 
Task Scheduling </H1></CENTER>
<HR SIZE=3>

<H2>Introduction</H2>Task scheduling is the assignment of starting and ending 
times to a set of tasks, subject to certain constraints. Constraints are 
typically either time constraints or resource constraints. On a time-sharing 
operating system, running each active process in turn for its share of time (its 
"timeslice"), thus creating the illusion that multiple processes are running 
simultaneously on a single processor. 
<P></P><EM>Wind</EM> task scheduling uses a priority based preemptive scheduling 
algorithm as default, but it can also accommodate round-robin scheduling.
<P></P>
<HR SIZE=3>

<H2>Objectives</H2>The following are the primary objectives of this experiment: 
<UL>
  <LI>To demonstrate the use of VxWorks round-robin task scheduling facilities. 
  </LI></UL>
<P></P>
<HR SIZE=3>

<H2>Description</H2>
<UL>
  <LI><B>Round-Robin Scheduling</B>
  <P></P>A round-robin scheduling algorithm attempts to share the CPU fairly 
  among all ready tasks of the same priority. Without round-robin scheduling, 
  when multiple tasks of equal priority must share the processor, a single task 
  can usurp the processor by never blocking, thus never giving other equal 
  priority tasks a chance to run.
  <P></P>Round-robin scheduling achieves fair allocation of the CPU to tasks of 
  the same priority by an approach known as <EM>time slicing</EM>. Each task 
  executes for a defined interval or <EM>time slice</EM>; then another task 
  executes for an equal interval, in rotation. The allocation is fair in that no 
  task of a priority group gets a second slice of time before the other tasks of 
  a group are given a slice.
  <P></P>Round-robin scheduling can be enabled with routine 
  <EM>kernelTimeSlice()</EM>, which takes a parameter for a time slice, or 
  interval. The interval is the amount of time each task is allowed to run 
  before relinquishing the processor to another equal priority task. </LI></UL>
<P></P>The following routine controls round-robin task scheduling:
<P></P>
<UL>
  <LI><EM>kernelTimeSlice(int ticks)</EM>: Control round-robin scheduling. The 
  number of ticks(60 ticks equate to one second) determine the duration of the 
  time slice. </LI></UL>
<P></P><B>1. Example: Round-robin Based Scheduling</B>
<P></P>In the example below, three tasks with the same priority print their task 
ids and task names on the console. Without round-robin scheduling, "taskOne" 
would usurp the processor until it was finished, and then "taskTwo" and 
"taskThree" would do likewise. In the event that "taskOne" was looping 
indefinitely, the other tasks would never get a chance to run.
<P></P>To insure that the tasks get an equal share of the CPU time, a call is 
made to <EM>kernelTimeSlice()</EM>. This sets the time slice interval value to 
<B>TIMESLICE</B>. The <B>TIMESLICE</B> value is the time slice interval in terms 
of the number of clock ticks(which in the example and the M68040 is 60 ticks 
which is equivalent to one second). The <EM>sysClkRateGet()</EM> can be used to 
determine the number of clock ticks per second.
<P></P>Having setup the time slice in the manner above, the three tasks are 
spawned. However, here a few implementation details that should be noted:
<P></P>
<UL>
  <LI>Make sure that sched has a higher priority than the tasks it is spawning! 
  Unless otherwise specified, tasks have a default priority of 100. Notice that 
  taskOne, taskTwo, and taskThree all have priorities of 101, which makes them 
  lower in priority than sched. </LI></UL>
<UL>
  <LI>Yow must allow enough time for the context switches to occur. Thus the 
  reason for -&gt; <B>for (j=0; j &lt; LONG_TIME; j++);</B> </LI></UL>
<UL>
  <LI>Using printf is not ideal in the example, because it can block .This will 
  of course cause a task transition which will upset the nice round robin 
  picture. Instead use <EM>logMsg()</EM> (see vxWorks reference manual for 
  details). The latter won't block unless the log message queue is full. 
</LI></UL><PRE>------------------------------------------------------------------------------------
/* includes */
#include "vxWorks.h"
#include "taskLib.h"
#include "kernelLib.h"
#include "sysLib.h"
#include "logLib.h"

/* function prototypes */
void taskOne(void);
void taskTwo(void);
void taskThree(void);

/* globals */
#define ITER1 100
#define ITER2 10
#define PRIORITY 101 
#define TIMESLICE sysClkRateGet()
#define LONG_TIME 1000000

void sched(void) /* function to create the three tasks */
{
int taskIdOne, taskIdTwo, taskIdThree;

if(kernelTimeSlice(TIMESLICE) == OK) /* turn round-robin on */
	printf("\n\n\n\n\t\t\tTIMESLICE = %d seconds\n\n\n", TIMESLICE/60);

/* spawn the three tasks */
if((taskIdOne = taskSpawn("task1",PRIORITY,0x100,20000,(FUNCPTR)taskOne,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn taskOne failed\n");
if((taskIdTwo = taskSpawn("task2",PRIORITY,0x100,20000,(FUNCPTR)taskTwo,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn taskTwo failed\n");
if((taskIdThree = taskSpawn("task3",PRIORITY,0x100,20000,(FUNCPTR)taskThree,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn taskThree failed\n");

}

void taskOne(void) 
{
int i,j;
for (i=0; i &lt; ITER1; i++)	
	{
	for (j=0; j &lt; ITER2; j++)
		logMsg("\n",0,0,0,0,0,0); /* log messages */
		for (j=0; j &lt; LONG_TIME; j++); /* allow time for context switch */	
	}
}

void taskTwo(void) 
{
int i,j;
for (i=0; i &lt; ITER1; i++)
	{
	for (j=0; j &lt; ITER2; j++)
		logMsg("\n",0,0,0,0,0,0); /* log messages */
		for (j=0; j &lt; LONG_TIME; j++); /* allow time for context switch */	
	}
}

void taskThree(void) 
{
int i,j;
for (i=0; i &lt; ITER1; i++)
	{ 
	for (j=0; j &lt; ITER2; j++)
		logMsg("\n",0,0,0,0,0,0); /* log messages */
		for (j=0; j &lt; LONG_TIME; j++); /* allow time for context switch */	
	}
}
------------------------------------------------------------------------------------
</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. Execute the following command on the WindSh terminal: "logFdSet 1". 
This will direct the <EM>logMsg()</EM> output to the virtual console.
<P></P>4. Run the examples by executing the main routine("sched") of the example 
on the WindSh terminal. 
<P></P>Note: Make sure you have redirected I/O, otherwise you won't see the 
results of the <EM>logMsg()</EM> commands. 
<HR SIZE=3>

<H2>Follow On Experiment</H2>Experiment 1. Why must the priority of "taskOne", 
"taskTwo", and "taskThree" be higher than "sched"?
<P></P>Experiment 2. Write the source code necessary to vary the time of 
<B>TIMESLICE</B>(10,20, 30,40,50,60,120,180,240 and 300 clock ticks). 
<P></P>Experiment 3. Add a fourth task(taskFour) that has a priority of 80 that 
prints out the same message as the other three tasks in the example. Describe 
the output from running the program. 
<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: 21 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>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频超级精品| 中文一区在线播放| 欧美日韩国产另类一区| 亚洲精品第1页| 91免费视频观看| 亚洲精品免费在线观看| 欧美最猛黑人xxxxx猛交| 亚洲影视资源网| 欧美人与禽zozo性伦| 日本欧美久久久久免费播放网| 欧美日精品一区视频| 日韩成人一区二区三区在线观看| 日韩色在线观看| 国产成人夜色高潮福利影视| 久久一二三国产| 99精品在线观看视频| 一个色在线综合| 日韩欧美www| 成人在线综合网| 亚洲综合在线免费观看| 91精品国产欧美日韩| 国产精品一区二区久激情瑜伽| 国产精品久久久久久久浪潮网站| 在线免费观看日本欧美| 秋霞午夜av一区二区三区| 久久精品一区二区| 欧美亚州韩日在线看免费版国语版| 日韩影院免费视频| 国产精品乱码妇女bbbb| 欧美视频一区二区在线观看| 麻豆国产精品777777在线| 国产精品素人一区二区| 欧美日本在线播放| 岛国精品在线播放| 天天综合天天综合色| 日本一区二区三区免费乱视频 | 亚洲欧美区自拍先锋| 欧美日本高清视频在线观看| 国产91丝袜在线播放0| 亚洲第一搞黄网站| 国产精品久久免费看| 3d成人h动漫网站入口| 成人免费av在线| 蜜臀精品一区二区三区在线观看 | 亚洲综合无码一区二区| 久久久精品tv| 欧美老年两性高潮| 97精品电影院| 国产成人精品影视| 亚洲久草在线视频| 国产一区在线看| 亚洲一区二区三区四区在线观看 | 国产精品国产三级国产普通话三级 | 91麻豆精品国产91久久久久久久久| 国产成人啪免费观看软件| 午夜伦理一区二区| 日韩理论片中文av| 久久久噜噜噜久久人人看| 91精品中文字幕一区二区三区| 99精品欧美一区| 国产成人在线视频网站| 久久99精品久久久久| 亚洲国产精品久久艾草纯爱| 国产精品久久福利| 国产肉丝袜一区二区| 精品免费日韩av| 91精品国产综合久久国产大片| 在线观看国产一区二区| 中文字幕日韩一区| 欧美日韩一区二区三区高清 | 国产一区二区不卡| 日韩不卡手机在线v区| 亚洲精品成人精品456| 国产精品国产自产拍在线| 日本一区二区三级电影在线观看 | 欧美一a一片一级一片| 99久久99久久久精品齐齐| 成人精品视频一区| 成人综合在线网站| 岛国精品一区二区| 91色porny在线视频| 99久久久久久| 91一区二区三区在线播放| 91麻豆福利精品推荐| 91一区一区三区| 91官网在线观看| 欧美日韩国产一二三| 不卡在线视频中文字幕| 成人av在线资源网站| 91小视频免费观看| 色偷偷一区二区三区| 欧美自拍偷拍一区| 欧美三级乱人伦电影| 日韩午夜在线影院| 欧美r级电影在线观看| 久久综合国产精品| 国产精品久久久久三级| 亚洲老司机在线| 亚洲成人资源网| 美日韩黄色大片| 国产一二精品视频| 91网站在线观看视频| 91成人国产精品| 在线不卡中文字幕| 久久免费国产精品| 亚洲品质自拍视频| 日韩中文字幕91| 国产精品一区二区在线播放 | 成人丝袜18视频在线观看| 91网页版在线| 91精品婷婷国产综合久久竹菊| 精品国产sm最大网站| 国产精品美女久久久久久2018| 亚洲图片激情小说| 亚洲一级二级三级| 精品亚洲国产成人av制服丝袜 | 91精品国产全国免费观看| 26uuu色噜噜精品一区二区| 国产精品毛片大码女人| 亚洲国产精品嫩草影院| 国产精品主播直播| 欧美色爱综合网| 久久久精品人体av艺术| 樱桃国产成人精品视频| 狠狠色狠狠色综合日日91app| 99久久伊人精品| 日韩美女视频在线| 亚洲免费在线电影| 精品一区二区三区蜜桃| 91蜜桃网址入口| 2024国产精品| 性做久久久久久免费观看| 国产99久久久久久免费看农村| 欧美日韩在线播放| 中文字幕一区二区不卡| 麻豆91在线播放| 欧美一a一片一级一片| 国产日韩v精品一区二区| 日韩在线观看一区二区| 99久久婷婷国产| 久久久久久97三级| 在线观看日韩电影| 欧美军同video69gay| 亚洲国产精品二十页| 日韩黄色免费电影| 色婷婷精品大在线视频| 国产午夜亚洲精品理论片色戒| 亚洲777理论| 99久久久久久| 国产精品无遮挡| 国内久久婷婷综合| 91精品在线一区二区| 亚洲午夜视频在线| 色综合咪咪久久| 国产精品乱码人人做人人爱| 精品一区二区三区免费| 欧美一三区三区四区免费在线看| 亚洲精品免费在线观看| 99精品视频在线观看免费| 亚洲国产一区二区三区| 91成人网在线| 1024精品合集| eeuss鲁片一区二区三区在线看| 精品成人一区二区| 九九视频精品免费| 精品日本一线二线三线不卡| 日产国产高清一区二区三区| 丝袜亚洲另类欧美| 日韩福利视频导航| 精品婷婷伊人一区三区三| 亚洲色欲色欲www| 99热国产精品| 国产精品剧情在线亚洲| 福利91精品一区二区三区| 久久久久久99精品| 国产成人h网站| 国产欧美一区二区三区在线看蜜臀 | 欧美亚洲国产怡红院影院| 亚洲男人的天堂av| 在线日韩国产精品| 亚洲超碰97人人做人人爱| 欧美日韩国产在线观看| 日韩影视精彩在线| 精品裸体舞一区二区三区| 精品亚洲欧美一区| 国产欧美日韩中文久久| a在线欧美一区| 一区二区三区日本| 91精品国产欧美一区二区成人| 美日韩一级片在线观看| 国产午夜精品福利| www.日本不卡| 亚洲一区二区高清| 亚洲3atv精品一区二区三区| 国产成人h网站| 欧美韩日一区二区三区| 97se亚洲国产综合自在线| 亚洲国产日韩一级| 精品国产三级a在线观看| 粉嫩久久99精品久久久久久夜|