• 大小: 80KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-03
  • 语言: 其他
  • 标签: 进程管理  

资源简介

操作系统实验报告-进程管理实验-时间片轮转调度算法模拟 时间片轮转调度算法模拟

资源截图

代码片段和文件信息

#include“stdio.h“
#include“stdlib.h“
#include“string.h“
#include“iostream.h“
typedef struct pcb
{
char pname[10];
int prio;
//int round;
int cputime;
int needtime;
int servertime;
char state;
struct pcb *next;
}PCB;
PCB *finish*ready*run;
int N;

void printready()
{
    PCB *p; 
   if(ready==NULL) printf(“******就绪队列为空! \n“);
   else 
   { 
        printf(“******就绪队列为:“);
        p=ready;
       while(p!=NULL) 
    { 
           printf(“%s---“p->pname);
           p=p->next; 
    } 
printf(“ \n “);
   }
}


void prt1() 
{
//if(toupper(a)==‘p‘)
//cout<<“ “<printf(“进程名 已运行时间 剩余时间 要求服务时间    状态\n“);
}

void prt2(PCB *q)    /*轮转法的输出*/
{
//if(toupper(a)==‘P‘)
//printf(“进程名   已运行时间    剩余时间    要求服务时间    状态“);
printf(“%3s%10d%12d%12d%12c\n“q-

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2791  2008-11-23 12:37  时间片轮转调度算法模拟.c

     文件     134144  2008-11-23 13:09  实验一.doc

----------- ---------  ---------- -----  ----

               136935                    2


评论

共有 条评论