太原理工大学操作系统实验报告2016 下载本文

内容发布更新时间 : 2024/12/23 10:48:54星期一 下面是文章的全部内容请认真阅读。

}

print();

void prisch() /*THE PROCESS WITH PRIO ALGORITHM*/ {

while (run != 0) {

prochain[run].cputime += 1; prochain[run].priority -= 3; prochain[run].alltime -= 1; if (prochain[run].alltime == 0) {

prochain[run].state = 'F'; prochain[run].next = 0; if (head != 0) { } else {

run = head;

prochain[run].state = 'R'; head = prochain[head].next;

prochain[0].id = prochain[run].id; run = 0; } else {

if ((prochain[run].priority< prochain[head].priority) && (head != 0)) {

prochain[run].state = 'W'; insert(run); run = head;

prochain[run].state = 'R'; head = prochain[head].next; }

}

}

}

}

print();

void timesch() /*THE PROCESS WITH RR ALRORITHM*/ {

while (run != 0) {

prochain[run].alltime -= 1; prochain[run].cputime += 1; if (prochain[run].alltime == 0) { } else {

if ((prochain[run].cputime == prochain[run]. {

prochain[run].state = 'W'; prochain[run].cputime = 0; priority) && (head != 0)) prochain[run].state = 'F'; prochain[run].next = 0; if (head != 0) { } else { }

prochain[0].id = prochain[run].id; run = 0; run = head;

prochain[run].state = 'R'; head = prochain[head].next;

}

}

insert2(); run = head;

prochain[run].state = 'R'; head = prochain[head].next;

print();

四、实验结果:

(1)

(2)