Question

Consider the following set of processes A, B, C, D with the following CPU burst time and I/O. Find the average waiting time w

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

Note ----> I/O is not included in waiting Time . Waiting time is also counted when process is ready and waiting in ready Queue to get the CPU

IN RR scheduling every process gets chance once time quantum of current process ends.

In gantt Chart we have 2 ms blocks that depicts Context Switch now Context Switch means when one Processes is leaving the CPU and context of other processes in loading onto the CPU

See table for each processes completion and waiting time and Gantt Chart Images

Process AT BT Ilo BI WT WT CT 24 2 3 30 25 A B c D 0 15 O 25 15 130 MB 21 | 155 52 키 32 113 12 104 167 Queue ACABCPABCDBC Rea

A B CO B BIC 72 76 78 88 to 100 102 104 106 109 111 113 As A has completed Flo so it resumes Π1 Α 1/10 B 13 116 134 155 Waiti

Explanation-->

1. First we have A and C arrived so schedule A for T = 0 to 10 msec

2. C is also ready so now C runs from T=12 to T=22 and now time T=10 to T=12 is for context switch

3. Again A comes back and runs

4.Now as B has Arrived At T = 15 so now it will run from T = 24 to 34

See Gantt chart for further execution sequence

5. D Arrives a T = 25 but it gets CPU at T= 60

6. Now A gets competed At T = 76 and started it's I/O time of 30 msec

7.Similarly B also finishes at T =113 and started it's I/O of 25 msec

8 All processes  completed their first CPU Burst Time till 113 and Now CPU is idle till T =116 as A I/O completes At T=116 So 3 msec CPU will be idle

8 From T = 116 to T=131 A completes it's second CPU Burst Time and gets Completed

8. Now CPU is again free as B I/O completes at T = 134 So Again for 3 sec CPU is idle

9. At last B completes it's second CPU time and gets completed at T = 155 msec

So the main concept here was how to handle the I/O time along with CPU Time .And as only A and B has I/O so this time is not included in their Waiting Time

Hence waiting time of process is

1 Waiting time of A = 14 ( i.e T=10 - T = 24 ) + 38 ( T = 34 - T= 72 ) = 52

2. Waiting Time of B = 21 + 32+ 18 = 71

3. Waiting Time of C = 81

4. Waiting Time of D = 67

Average Waiting Time = 52 + 71 + 81 + 67 / 4 = 271/4 = 67.75

This is how using RR scheduling you can calculate the waiting time of each process

If u any kind of doubt comment it

and If u like the answer then give it a thumbs up

Add a comment
Know the answer?
Add Answer to:
Consider the following set of processes A, B, C, D with the following CPU burst time...
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
  • Given the following set of processes---with the specified length of the CPU burst, arrival time, and...

    Given the following set of processes---with the specified length of the CPU burst, arrival time, and priority---compute response time for P1-P5 with round-robin scheduling with time quantum of 10 units. Also compute average response time. Assume that a newly arriving process arrives first at time T- and a process that is preempted due to the completion of its quantum arrives at time T+ in the waiting queue. (Note: Show the Gantt chart and other working details in your worksheet.) Process...

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

  • Assume that the three processes arrived in order: Processes                            CPU Burst Time P1  &n

    Assume that the three processes arrived in order: Processes                            CPU Burst Time P1                                           17 P2                                            6 P3                                            8 a.     Please draw the Gantt chart if FCFS scheduling is used. b.    Please calculate the average waiting time and average completion time under FCFS. You MUST show the calculation procedure. c.      Please draw the Gantt chart if Round Robin is used. d.    Please calculate the average waiting time and completion time under RR with q = 3. You MUST show the calculation...

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

    Consider the following set of processes, with the length of CPU burst in milliseconds. Process PI P2 P3 P4 P5 Arrival time 00 02 03 06 30 Burst time 10 12 14 16 05 Draw a Gantt chart that illustrates the execution of these processes using the preemptive shorte st job first (SJF) algorithm. Hence find the average waiting time. Draw a Gantt chart that illustrate the execution of these processes using preemptive priority scheduling algorithm. Given priority of each...

  • 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 given in milliseconds...

    Consider the following set of processes, with the length of the CPU burst given in milliseconds Assume a time slice of 10. Compute the average waiting time of each process for FIFO, SJF, and RR algorithms Process PO Pl P2 P3 P4 Burst Time 75 40 25 20 45 Arrival Time 0 10 10 80 85

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

  • Computer Science Help Instructions Consider the following set of processes, with the length of the CPU-burst...

    Computer Science Help Instructions Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Burst Time Process P1 P2 Priority 10 4 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, a nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum 1) scheduling. b. What is the...

  • C language show all work 1. [50 pts] Given the following set of processes, with arrival...

    C language show all work 1. [50 pts] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Arrival Time Burst time Process P1 P2 P3 P4 4. 3 2 0 0 10 (Note: lower number means higher priority, processes P1, P2, P3, and P4 arrive at the same time, in the given order). a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing...

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