Question

##1, Assume that you have the following processes all arriving at time 0: Process Burst Priority...

##1, Assume that you have the following processes all arriving at time 0:

Process

Burst

Priority

P1

8

4

P2

6

1

P3

1

2

P4

9

2

P5

3

3

For each of the following CPU scheduling algorithms, determine the turnaround and wait times for each process as well as the average wait and turnaround times.

v First Come First Serve

v non-preemptive SJF

v preemptive SJF

v Non-Preemptive Priority Scheduling

v Round Robin (assume a quantum of 1)

Which of the four algorithms has the shortest wait time? Which has the fastest average turnaround time?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Turn around time = completion time - arrival time

Waiting time = turn around time - burst time

As arrival time is 0 fir all the processes, turn around time and completion time will be same for all the CPU scheduling types.

FCFS:

Process

Burst time Completion time Waiting time Turn around time
P1 8 8 0 8
P2 6 14 8 14
P3 1 15 14 15
P4 9 24 15 24
P5 3 27 24 27

Non preemptive SJF:

Process

Burst time Completion time Waiting time

Turn around time

P1 8 18

10

18
P2 6 10 4 10
P3 1 1 0 1
P4 9 27 18 27
P5 3 4 1 4


Preemptive SJF:

Both non preemptive and preemptive SJF are same as the arrival time for all the processes are 0. Hence the process with shortest burst time will be processed at any time in both the scheduling types.

Process

Burst time Completion time Waiting time

Turn around time

P1 8 18

10

18
P2 6 10 4 10
P3 1 1 0 1
P4 9 27 18 27
P5 3 4 1 4

Non-preemptive priority based:

Process

Burst time Completion time Waiting time

Turn around time

P1 8 27

19

27
P2 6 6 0 6
P3 1 7 6 7
P4 9 16 7 16
P5 3 19 16 19

Round robin(qt : 1):

Process

Burst time Completion time Waiting time

Turn around time

P1 8 25

17

25
P2 6 21 15 21
P3 1 3 2 3
P4 9 27 18

27

P5 3 13 10

13

Thus

The shortest waiting time: 18

The algorithms that have shortest waiting time are:

Non preemptive SJF, preemptive SJF and round robin

Average turn around time for fcfs:

(8+14+15+24+27)/5=88/5=17.6

Average turn around time for non preemptive SJF & preemptive SJF:

(18+10+1+4+27)/5=60/5=12

Average turn around time for non-preemptive priority based:

(27+6+7+19+16)/5=75/5=15

Average turn around time for Round robin:

(25+27+3+21+13)/5=89/5=17.8

Fast average turnaround time is for: Non-preemptive and preemptive SJF

Add a comment
Know the answer?
Add Answer to:
##1, Assume that you have the following processes all arriving at time 0: Process Burst Priority...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 4. Consider a ready queue with four processes :- Process Arrival Time Burst Time (ms) P1...

    4. Consider a ready queue with four processes :- Process Arrival Time Burst Time (ms) P1 Priority P2 P3 P4 P5 For each of the following CPU scheduling algorithms, determine the turnaround and average waiting time for each of the process :- a. Shortest remaining Time First b. Shortest Job First C. Priority Scheduling (Both pre-emptive and non-preemptive) d. Round Robin (quantum is 1 ms)

  • 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:Processburst TimePriorityP1103P211P323P414P552For each of the scheduling algorithms, FCFS, Shortest-Job-First (SJF, non-preemptive), Priority (smaller priority number implies higher scheduling priority), and RR (quantum = 1) do the following.Draw a Gantt chart to show how these processes would be scheduled.Give the turnaround time (total time from the first arrival into ready state until CPU-burst is completed) of each process.Give the waiting time (total time spent in the Ready state) of each process.Give...

  • Q.2] Answer the following questions Process Burst Time Priority P1 3 1 P2 8 3 P3...

    Q.2] Answer the following questions Process Burst Time Priority P1 3 1 P2 8 3 P3 2 4 P4 4 5 P5 5 1 (21 points) 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,...

  • 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 P1                    10                    3 P2                    1                     1 P3                    2                     3 P4                    1                     4 P5                    5                     2 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF (SPN), a...

  • QUESTION 1 Consider the following set of processes, with the length of the CPU burst time...

    QUESTION 1 Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process            Burst Time      Priority P1                    7                      5 P2                    2                      4 P3                    11                    3 P4                    9                      1 P5                    5                      3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 2). b. What...

  • 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:ProcessBurst TimePriorityP1 54P231P312P472P543The processes are assumed to have arrived in the order P1 , P2 , P3 , P4 , P5 , all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a larger priority number implies a higher priority), and RR (quantum = 2). b. What is the turnaround time of each...

  • 8. Consider the following 5 processes in the ready queue: Process Burst Priority Arrival time n...

    8. Consider the following 5 processes in the ready queue: Process Burst Priority Arrival time n w P1 P2 w N P3 P P - W WE O P4 N P5 N A O Draw Gantt charts illustrating the execution of these processes for each of the following algorithms: (a) preemptive SJF, (b) RR (with quantum = 1), (C) FCFS, and (d) preemptive priority, and calculate the respective turnaround and waiting times.

  • Given the following set of processes with corresponding execution times (in ms), arrival times and priority...

    Given the following set of processes with corresponding execution times (in ms), arrival times and priority (1 – highest).  For each scheduling algorithm: Construct a table showing which process is active and for how long until all processes are completely serviced (as done in class). Calculate the average waiting time and turnaround time. Process ID Burst (ms) Arrival time P1 9 0 P2 12 0 P3 3 0 P4 30 0 P5 20 0 P6 10 0 First Come First Serve...

  • Consider the following set of processes, with the length of the CPU burst time given in...

    Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process            Burst Time      Priority P1                    7                      5 P2                    2                      4 P3                    11                    3 P4                    9                      1 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, nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 2). * Please provide a chart...

  • Please answer the following question in C++ language Consider the following set of processes, with the...

    Please answer the following question in C++ language Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process            Burst Time      Priority P1. 7 5 P2 2 4 P3 11 3 P4 9 1 P5 5 3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT