(完整word版)时间片轮转算法和优先级调度算法C语言模拟实现收藏.pdf
实用标准文案精彩文档时间片轮转算法和优先级调度算法 C 语言模拟实现收藏一、目的和要求进程调度是处理机管理的核心内容。本实验要求用高级语言编写模拟进程调度程序,以便加深理解有关进程控制快、进程队列等概念,并体会和了解优先数算法和时间片轮转算法的具体实施办法。二、实验内容1.设计进程控制块PCB的结构,通常应包括如下信息:进程名、进程优先数(或轮转时间片数)、进程已占用的CPU 时间、进程到完成还需要的时间、进程的状态、当前队列指针等。2.编写两种调度算法程序:优先数调度算法程序循环轮转调度算法程序3.按要求输出结果。三、提示和说明分别用两种调度算法对伍个进程进行调度。每个进程可有三种状态;执行状态(RUN)、就绪状态(READY,包括等待状态)和完成状态(FINISH),并假定初始状态为就绪状态。(一)进程控制块结构如下:NAME 进程标示符PRIO/ROUND进程优先数/进程每次轮转的时间片数(设为常数2)CPUTIME 进程累计占用CPU 的时间片数NEEDTIME进程到完成还需要的时间片数STATE 进程状态NEXT 链指针注:1.为了便于处理,程序中进程的的运行时间以时间片为单位进行计算;2.各进程的优先数或轮转时间片数,以及进程运行时间片数的初值,均由用户在程序运行时给定。实用标准文案精彩文档(二)进程的就绪态和等待态均为链表结构,共有四个指针如下:RUN 当前运行进程指针READY 就需队列头指针TAIL就需队列尾指针FINISH完成队列头指针(三)程序说明1.在优先数算法中,进程优先数的初值设为:50-NEEDTIME每执行一次,优先数减1,CPU 时间片数加 1,进程还需要的时间片数减1。在轮转法中,采用固定时间片单位(两个时间片为一个单位),进程每轮转一次,CPU 时间片数加 2,进程还需要的时间片数减2,并退出 CPU,排到就绪队列尾,等待下一次调度。2.程序的模块结构提示如下:整个程序可由主程序和如下7 个过程组成:(1)INSERT1 在优先数算法中,将尚未完成的 PCB 按优先数顺序插入到就绪队列中;(2)INSERT2 在轮转法中,将执行了一个时间片单位(为2),但尚未完成的进程的 PCB,插到就绪队列的队尾;(3)FIRSTIN调度就绪队列的第一个进程投入运行;(4)PRINT 显示每执行一次后所有进程的状态及有关信息。(5)CREATE创建新进程,并将它的PCB插入就绪队列;(6)PRISCH 按优先数算法调度进程;(7)ROUNDSCH按时间片轮转法调度进程。主程序定义 PCB结构和其他有关变量。(四)运行和显示程序开始运行后,首先提示:请用户选择算法,输入进程名和相应的NEEDTIME值。每次显示结果均为如下5 个字段:name cputime needtime priority state文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G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E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4实用标准文案精彩文档注:1在 state字段中,R代表执行态,W代表就绪(等待)态,F代表完成态。2应先显示 R态的,再显示 W态的,再显示 F 态的。3在W态中,以优先数高低或轮转顺序排队;在F 态中,以完成先后顺序排队。view plaincopy to clipboardprint?1./*2.操作系统实验之时间片轮转算法和优先级调度算法3.By Visual C+6.0 4.*/#include#include#include typedef struct node charname20;/*进程的名字*/intprio;/*进程的优先级*/intround;/*分配 CPU的时间片*/intcputime;/*CPU 执行时间*/intneedtime;/*进程执行所需要的时间*/charstate;/*进程的状态,W 就绪态,R执行态,F完成态*/intcount;/*记录执行的次数*/struct node*next;/*链表指针*/PCB;PCB*ready=NULL,*run=NULL,*finish=NULL;/*定义三个队列,就绪队列,执行队列和完成队列*/intnum;文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L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I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4实用标准文案精彩文档void GetFirst();/*从就绪队列取得第一个节点*/void Output();/*输出队列信息*/void InsertPrio(PCB*in);/*创建优先级队列,规定优先数越小,优先级越高*/void InsertTime(PCB*in);/*时间片队列*/void InsertFinish(PCB*in);/*时间片队列*/void PrioCreate();/*优先级输入函数*/void TimeCreate();/*时间片输入函数*/void Priority();/*按照优先级调度*/void RoundRun();/*时间片轮转调度*/intmain(void)charchose;printf(请输入要创建的进程数目:n);scanf(%d,&num);getchar();printf(输入进程的调度方法:(P/R)n);scanf(%c,&chose);switch(chose)case P:case p:PrioCreate();Priority();break;case R:case r:TimeCreate();RoundRun();break;文档编码:CB3L6Q4O4G6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8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4实用标准文案精彩文档default:break;Output();return 0;void GetFirst()/*取得第一个就绪队列节点*/run=ready;if(ready!=NULL)run-state=R;ready=ready-next;run-next=NULL;void Output()/*输出队列信息*/PCB*p;p=ready;printf(进程名 t 优先级 t 轮数 tcpu时间 t 需要时间 t 进程状态 t 计数器n);while(p!=NULL)printf(%st%dt%dt%dt%dtt%ctt%dn,p-name,p-prio,p-round,p-cputime,p-needtime,p-state,p-count);p=p-next;p=finish;while(p!=NULL)文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 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4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4实用标准文案精彩文档 printf(%st%dt%dt%dt%dtt%ctt%dn,p-name,p-prio,p-round,p-cputime,p-needtime,p-state,p-count);p=p-next;p=run;while(p!=NULL)printf(%st%dt%dt%dt%dtt%ctt%dn,p-name,p-prio,p-round,p-cputime,p-needtime,p-state,p-count);p=p-next;void InsertPrio(PCB*in)/*创建优先级队列,规定优先数越小,优先级越低*/PCB*fst,*nxt;fst=nxt=ready;if(ready=NULL)/*如果队列为空,则为第一个元素*/in-next=ready;ready=in;else/*查到合适的位置进行插入*/if(in-prio=fst-prio)/*比第一个还要大,则插入到队头*/in-next=ready;文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6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7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4实用标准文案精彩文档ready=in;else while(fst-next!=NULL)/*移动指针查找第一个别它小的元素的位置进行插入*/nxt=fst;fst=fst-next;if(fst-next=NULL)/*已经搜索到队尾,则其优先级数最小,将其插入到队尾即可*/in-next=fst-next;fst-next=in;else/*插入到队列中*/nxt=in;in-next=fst;void InsertTime(PCB*in)/*将进程插入到就绪队列尾部*/PCB*fst;fst=ready;文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q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3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4文档编码:CB3L6Q4O4G6 HY5I7E3Z7E8 ZE3Z7W4M8K4实用标准文案精彩文档if(ready=NULL)in-next=ready;ready=in;else while(fst-next!=NULL)fst=fst-next;in-next=fst-next;fst-next=in;void InsertFinish(PCB*in)/*将进程插入到完成队列尾部*/PCB*fst;fst=finish;if(finish=NULL)in-next=finish;finish=in;else while(fst