-CPU system has four processes, P1, P2, P3 and P4 in the ready queue. The execution times and I/O needs for these processes are given below. All times are in ms. (hint: when a process starts an IO operation, it is removed from the ready queue and put back at the end of the queue only when it completes its IO). Process P1: Arrives at 0ms, needs 23ms of CPU time. Performs I/O for 5ms after 10ms of its execution time, then another 5ms after 20ms of its execution time. Process P2: Arrives at 3ms, needs 12ms of CPU time. Performs I/O for 10ms after 5ms of its execution time. Process P3: Arrives
A single-CPU system has four processes, P1, P2, P3 and P4 in the ready queue. The execution times and I/O needs for these processes are given below. All times are in ms. (hint: when a process starts an IO operation, it is removed from the ready queue and put back at the end of the queue only when it completes its IO).
Process P1: Arrives at 0ms, needs 23ms of CPU time. Performs I/O for 5ms after 10ms of its execution time, then another 5ms after 20ms of its execution time.
Process P2: Arrives at 3ms, needs 12ms of CPU time. Performs I/O for 10ms after 5ms of its execution time.
Process P3: Arrives at 1ms, needs 15ms of CPU time. Performs I/O for 1ms after 7ms of its execution time.
Process P4: Arrives at 2ms, needs 8ms of CPU time. Performs I/O for 5ms after 4ms of its execution time.
We assume that the CPU is idle if no one of these four processes is using it.
Using Round Robin scheduling
a) The order of execution of the processes (preferably as a Gantt chart), clearly indicating the CPU times as well as I/O times for each process. I/O requests are performed using FCFS strategy and only one process can be served by I/O at a time.
b)The waiting time and the turnaround times for each process.
c) The average waiting time, the average turnaround time and the percentage CPU utilization
Now, suppose that the IO system consists of 3 types of resources R1 (7 instances), R2 (9 instances) and R3 (12 instances). The allocated and maximum required (requested) resources for each process are given below:
Process |
Requested/Allocated |
||
|
R1 |
R2 |
R3 |
P1 |
3/2 |
0/0 |
10/4 |
P2 |
3/1 |
6/1 |
4/2 |
P3 |
0/0 |
4/1 |
8/4 |
P4 |
4/3 |
7/5 |
0/0 |
d)Determine the available
e) Is the system in a safe mode? If yes, give the sequence(s) that result(s) in a safe, if no (the system in a deadlock), what do you suggest to recover from it?
Step by step
Solved in 2 steps with 1 images