Question

XCOB 8 pts Question 1 The fill-in-the-blanks of this question are based on the problem data given below where 5 processes arr

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Process Burst Time Priority
P1 1 1
P2 1 4
P3 2 3
P4 5 2
P5 10 3

Turnaround time is the time a process spends upon its arrival in ready queue till its execution completes. Since the arrival time is not given in the problem, we will assume all process arrive at t = 0.

Waiting time is the time for which a process has to wait. Waiting time is given as: Turnaround Time - Burst time

A) In SJF (Shortest Job First) we select the process which has the least Burst Time and give it CPU execution until the process finishes. If two jobs have the same burst time, then we pick the process which arrived earlier.

The Gantt Chart for the above process will be as follows :

2 4. 0 1 P1 P2 P3 P3 P4 P5

Process Arrival Time Burst Time(BT) Completion Time (CT) Turnaround Time (TT = CT - AT) Waiting Time( TT - BT)
P1 0 1 1 1 0
P2 0 1 2 2 1
P3 0 2 4 4 2
P4 0 5 9 9 4
P5 0 10 19 19 9
Total 35 16

Average Waiting Time = Total Waiting Time/5 = 3.2

B) In RR(Round Robin) scheduling we give each process a max n quanta CPU time. If the process finishes within this time or the time quanta expires, the control is transferred to next process in ready queue. If the process has remaining execution time left then the process is added to the tail of the ready queue.

The Gantt Chart is as follows:

q = 2 (r): remaining time 0 1 2 P1(0) P210) 10 P4(1) 12 13 P5(6) P4(0) P3(0) P4(3) P5(8) 19 P5(0)

Process
Process Arrival Time Burst Time(BT) Completion Time (CT) Turnaround Time (TT = CT - AT) Waiting Time( TT - BT)
P1 0 1 1 1 0
P2 0 1 2 2 1
P3 0 2 4 4 2
P4 0 5 13 13 8
P5 0 10 19 19 9
Total 39 20

Average Turnaround Time = Total Turnaround Time/5 = 7.8

C) In Non Preemptive Priority Scheduling the process with highest priority is given CPU time until it completes it execution. If two processes have same priority, then process is chosen according to arrival time.

The Gantt chart is as follows:

1 18 19 0 P1 P4 P3 P5 PZ

Process Arrival Time Burst Time(BT) Priority Completion Time (CT) Turnaround Time (TT = CT - AT) Waiting Time( TT - BT)
P1 0 1 1 1 1 0
P2 0 1 4 19 19 18
P3 0 2 3 8 8 6
P4 0 5 2 6 6 1
P5 0 10 3 18 18 8
Total 52 33

Average Waiting Time = Total Waiting time / 5 = 6.6

D) Refer the above table

Average Turnaround Time = Total Turnaround Time/5 = 10.4

Add a comment
Know the answer?
Add Answer to:
XCOB 8 pts Question 1 The fill-in-the-blanks of this question are based on the problem data...
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
  • Cpu scheduling

    Consider the following set of processes, with the length of the CPU burst times given in milliseconds:a. Draw four Gantt charts illustrating the execution of the processes using FCFS, Preemptive SJF, a non-preemptive priority, and a RR (quantum=2) scheduling. (30 pts)Note: for the RR consider that the arriving time is 0 for all processesb. What is the average waiting time of each process for of the above scheduling algorithms? (10 pts)P1 8 2 0 P2 5 36P3 1 1 8...

  • 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 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...

  • 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...

  • 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...

  • 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,...

  • 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...

  • 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...

  • 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)

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
ADVERTISEMENT