Sunteți pe pagina 1din 1

CPU Scheduling Algorithms

1. Consider the following set of five processes P1, P2, P3, P4, and P5. The priorities and the
lengths of the CPU-burst time in milliseconds are given below.

Process Burst Time Priority


P1 8 5
P2 1 1
P3 2 3
P4 3 4
P5 5 2

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. A smaller
priority number indicates a higher priority.
Draw Gantt chart demonstrating the execution of the processes and compute the average waiting
time (AWT) of each of the following CPU scheduling algorithms.
a. First-come, first-served (FCFS)
b. Nonpreemptive shortest-job-first (SJF)
c. Nonpreemptive priority (a smaller priority number indicates a higher priority)
d. Round-robin (RR) with time quantum = 2

2. Consider the following set of five processes P1, P2, P3, P4, and P5. The priorities and the
lengths of the CPU-burst time in milliseconds are given below.

Process Burst Time Priority


P1 9 5
P2 1 1
P3 3 4
P4 4 3
P5 6 2

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. A smaller
priority number indicates a higher priority.
Draw Gantt charts demonstrating the execution of the processes and compute the average
waiting time (AWT) of each of the following CPU scheduling algorithms.
a. First-come, first-served (FCFS)
b. Nonpreemptive shortest-job-first (SJF)
c. Nonpreemptive priority (a smaller priority number implies a higher priority)
d. Round-robin (RR) with time quantum = 2

S-ar putea să vă placă și