c语言 进程调度 短作业,进程调度(C语言实现)

模拟进程调度算法,实现先到先服务(FCFS)、短作业优先(SJF)、时间片轮转(RR)、优先权调度(短作业优先类似请自己完成)。采用链表的存储方式,具有选择界面,可重复操作,对每一种算法都计算完成时间、周转时间、带权周转时间并输出各种调度算法信息。

#include #include #include

typedef struct ProcessNode{ // 进程结点的基本结构 char name; //进程名

struct SJF_time{ //短作业优先

struct RR_time{ //时间片轮转的结点

struct Pri_time{ //优先权非抢占式

void main() {

int choice;

struct ProcessNode*next; }ProcessNode,*Linklist;

int finish_time; int turnaround_time; float weigtharound_time;

int finish_time; int turnaround_time; float weigtharound_time;

int flag_time;//赋值为进程的服务时间,为0则进程完成

int finish_time; int turnaround_time; float weigtharound_time; int flag;

struct FCFS_time{ //先到先服务

int finish_time; //完成时间 int turnaround_time; //周转时间 float weigtharound_time;//带权周转时间 int service_time; //服务时间 int arrive_time; //到达时间 int priority; //优先级

}FCFS_time;

}SJF_time;

}RR_time;

}Pri_time;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值