进程调度算法实现代码(操作系统).docVIP

  • 33
  • 0
  • 约3.55千字
  • 约 7页
  • 2016-03-05 发布于江苏
  • 举报
进程调度算法实现//数据:进程,队列结构 ?//处理流程: ?//1 初始化--进程队列结构(包括:就绪队列,等待队列,运行队列)等必要的数据结构 init(); ?//2 进入无限循环,反复调度队列? ?#define MAX 5 ?#includestdio.h ?#includestdlib.h ? ?int total_time=20; ?int time_slice=3; ? ?typedef struct process {??? // 进程控制块 ?????char pname[10]; ?????int WaitTime; ?????int BurstTime; ?????int priority;??? // 数字越小优先级越高 ?????struct process *next; ?????}PROCESS; ? ?? //typedef struct process PROCESS; ?PROCESS * in_queue(PROCESS *head,PROCESS *p);? //声明 ?? ?? PROCESS *init()?? //进程初始化 ?{ ??int i=0; ???? char a; ??PROCESS *head_new;? //队列的队头 ??head_new=(struct process*)malloc(sizeof(struct

文档评论(0)

1亿VIP精品文档

相关文档