全文预览

采用时间片轮转算法的进程调度程序

上传者:qnrdwb |  格式:doc  |  页数:17 |  大小:0KB

文档介绍
Rundl->headzz->wctime=time; Rundl->headzz->zztime=Rundl->headzz->wctime-Rundl->headzz->ddtime ;Rundl->headzz->w_zztime=((float)(Rundl->headzz->zztime))/Rundl->h eadzz->yqtime; tem=tem+timepice; RdlCZ(Rundl->headzz,Finishdl); CdlCZ(Rundl->headzz,Rundl); 7 }}}JCdltime(Readydl,time+1); }system("cls"); XSdl(Finishdl); printf("\n"); JStime(Finishdl); } 3.3 测试用例及运行结果所选择的数据如下表: 进程名到达时间服务时间 104 213 325 432 544 运行结果部分截图如下图所示: 89 10 第4 部分源代码#include <stdio.h> #include<malloc.h> #include<string.h> #include<windows.h> typedef struct PCB //结构体{ int processID; //进程名 char state; //状态 int ddtime; //到达时刻 int yqtime; //要求服务时间 int yxtime; //已运行时间 int wctime; //结束运行时刻 int zztime; //周转时间 float w_zztime;// 带权周转时间 struct PCB *next; }PCB; typedef struct { PCB *headzz; //队头指针 PCB *endzz; //队尾指针 int count; //队列结点个数

收藏

分享

举报
下载此文档