The assignment is to be handed in class. No late assignments will be accepted.
An operating system uses multi-level feedback (with preemption) for CPU scheduling. There are 3 feedback queues with associated quanta 1, 2, and 3 time units.
Consider the following workload:
|
Process |
Arrival Time |
CPU Requirements |
|
p1 |
1 |
6 |
|
p2 |
3 |
8 |
|
p3 |
6 |
4 |
|
p4 |
9 |
3 |
|
p5 |
11 |
5 |
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
int a = 8;
int b = 2;
int main(){
pid_t pid;
if ((pid = fork()) == 0){ /*child process */
a += 3;
b = a + 4;
}
else if( pid>0 ){ /*parent process*/
a += 4;
b += a;
printf("Parent: a = %d, b= %d,", a, b); /* LINE A */
exit(0);
}
}
Throughput, response time and fairness are the common performance metrics
used to evaluate a scheduling algorithm.
Consider a variant of the RR scheduling algorithm where the entries in the ready
queue are pointers to the PCBs.
Consider the following preemptive priority-scheduling algorithm based on
dynamically changing priorities. Larger priority numbers imply higher priority.
when a process is waiting for the CPU (in the ready queue, but not running),
its priority changes at a rate a; when it is running, its priority changes
at a rate b. All processes are given a priority of 0 when they enter the
ready queue. the parameters a and b can be set to given many
different scheduling algorithms.