Question

In: Computer Science

Consider the following set of processes, with the length of the CPU burst given in milliseconds:...

Consider the following set of processes, with the length of the CPU burst given in milliseconds:

Process

Burst Time

Priority

P1

2

2

P2

1

1

P3

8

4

P4

4

2

P5

5

3

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.

Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, non preemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 2).

Solutions

Expert Solution

FCFS Gantt chart

The processes are have arrived in the order P1, P2, P3, P4, P5, all at time 0.

first come, first served (FCFS) P1 first came,then P2, then P3, then P4, last one is P5

SJF Gantt chart

Shortest job first (SJF) is  selects the waiting process with the smallest execution time to execute next.

P2 brust time is 1

P1 brust time is 2

P4 brust time is 4

P5 brust time is 5

P3 brust time is 8

Non preemptive priority  Gantt chart (a smaller priority number implies a higher priority)

P1 and P4 have same priority. P1 execute first, Then P4.

P2 priority 1

P1 priority 2

P4 priority 2

P5 priority 3

P3 priority 4

Round Robin (quantum = 2) Gantt chart

Round Robin : each process is assigned a fixed time slot in a cyclic way.

Each process have 2 millisecond of time. Reapeat the cycle until complete all processes.


Related Solutions

Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4            The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. If FCFS scheduling is used, what is the average turnaround time of these processes? Answer: Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4           ...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Arrival Time Burst Time P1 0 5 P2 2 3 P3 3 2 P4 4 4 P5 5 3 a. Draw Gantt charts illustrating the execution of these processes using SJF pre-emptive b. What is the turnaround time of each process for each of the scheduling algorithms c. What is the waiting time of each process for each of the scheduling algorithms  
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority Arrival Time P1 10 3 0 P2 1 1 12 P3 2 4 0 P4 1 5 0 P5 5 2 0 In the above table, a smaller priority number implies a higher priority. Suppose that these processes are scheduled by the priority policy with preemption. Draw the Gantt chart (i.e., time chart) illustrating the execution of these processes. What...
1. Consider the following set of processes, with the length of CPU burst and arrival time...
1. Consider the following set of processes, with the length of CPU burst and arrival time given in milliseconds.                                                              Process            Burst time       Priority            Arrival Time             P1                         10                    3                              0 P2                          1                     1                              2 P3                          2                     4                              4 P4                          5                     2                              8 a) Draw the Gantt chart that illustrates the execution of these processes using the preemptive priority scheduling algorithm (a smaller priority number implies a higher priority). b) What...
Consider the set of processes shown in the table above, with the length of the CPU-burst...
Consider the set of processes shown in the table above, with the length of the CPU-burst time given in milliseconds. The processes are assumed to have arrived in the order P5, P4, P3, P2 , and P1, all approximately at time 0. Draw three Gantt charts illustrating the execution of these processes using SJF, Round-Robin (quantum size = 3), and a non-preemptive priority (a smaller priority number implies a higher priority) scheduling. Calculate average waiting time of each scheduling. Calculate...
A set of processes along with their burst time in milliseconds is given below. The processes...
A set of processes along with their burst time in milliseconds is given below. The processes should execute in First Come First Served order. Assume that the quantum (q) is 3: Process Burst Time P1 22 P2 4 P3 12 P4 15 P5 2 Find the average waiting time using the Round Robin algorithm. Round your answer to 2 decimal places
You are given the following processes with CPU-burst time, arrival time and priority (lower # means...
You are given the following processes with CPU-burst time, arrival time and priority (lower # means higher priority) Process CPU-burst Arrival time Priority P1 12 0 5 P2 6 6 2 P3 9 1 2 P4 14 3 1 P5 7 5 4 For each of the following scheduling algorithm, show (using the diagram as in the slides), how the process are being executed. Also calculate the average wait time. Shortest job first (non-preemptive) Shortest remaining job first (preemptive) Priority-based...
6. Consider the following set of processes P1, P2, P3, P4. Process Burst Time Arrival Time...
6. Consider the following set of processes P1, P2, P3, P4. Process Burst Time Arrival Time Priority P1 3 0 1 P2 5 1 2 P3 8 3 3 P4 4 4 2 a) Draw Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: first-come, first-served (FCFS), priority scheduling (larger number=high priority), and Round-Bobin (RR, quantum=2). b) Compute the average waiting time, turnaround time for the three algorithms. Turnaround time – amount of time to...
Consider the following set of jobs to be scheduled for execution on a single CPU system....
Consider the following set of jobs to be scheduled for execution on a single CPU system. Job Arrival Time Burst (msec) Priority A 0 6 3 (Silver) B 1 2 1 (Diamond) C 3 5 3 (Silver) D 5 3 4 (Bronze) E 7 2 2 (Gold)    (a)     Draw a Gantt chart showing First-Come-First-Served (FCFS) scheduling for these jobs. (b)     Draw a Gantt chart showing preemptive PRIORITY scheduling. (c)    Draw a Gantt chart showing Highest Response Ratio Next (HRRN) scheduling. (d)     Draw a...
Consider the following set of jobs to be scheduled for execution on a single CPU system....
Consider the following set of jobs to be scheduled for execution on a single CPU system. Job Arrival Time Burst (msec) Priority A 0 6 3 (Silver) B 1 2 1 (Diamond) C 3 5 3 (Silver) D 5 3 4 (Bronze) E 7 2 2 (Gold)    Draw a Gantt chart showing First-Come-First-Served (FCFS) scheduling for these jobs.       Draw a Gantt chart showing preemptive PRIORITY scheduling. Draw a Gantt chart showing Highest Response Ratio Next (HRRN) scheduling.     Draw a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT