删除进程未完成
代码:
#include "stdio.h"
#include <stdlib.h>
#include <conio.h>
#define getpch(type) (type*)malloc(sizeof(type))
#define NULL 0
// ¶¨Òå½ø³Ì¿ØÖÆ¿éPCB
struct pcb{
// ½ø³ÌÃû×Ö
char name[10];
// ½ø³ÌÊÇ·ñÔËÐÐ
char state;
// ½ø³ÌÓÅÏȼ¶Êý
int super;
int ntime;
int rtime;
// ÏÂÒ»¸ö½ø³Ì
struct pcb* link;
}*ready=NULL,*p,*res;
typedef struct pcb PCB;
// ½¨Á¢¶Ô½ø³Ì½øÐÐÓÅÏȼ¶ÅÅÁк¯Êý
//void sort(){
// int l=0;
// PCB* pr=ready;
// while(pr!=NULL){
// l++;
// pr=pr->link;
// }
// pr=p;
// printf("l: %d\n",l);
//}
// ·µ»Ø¾ÍÐ÷¶ÓÁеij¤¶È
int space(){
int l=0;
PCB* pr=ready;
while(pr!=NULL){
l++;
pr=pr->link;
}
return(l);
}
// °´ÕÕÓÅÏÈÊý½øÐÐÅÅÐò ¿ÉÇÀÕ¼
//void sort(){
// int len=space();
// if(len==1){
// if(ready->super>p->super){
// p->link=ready;
// ready=p;
// }else{
// r