Question
question is based on operating system concept. round roubin algorith

4 5 6 Use Round Robin algorithm with a time quantum of 5 7 proc arrival service num time time 8 9 waiting time response time
0 0
Add a comment Improve this question Transcribed image text
Answer #1

At time 0, P1 arrives.Round Robin Ready queue is empty then.CPU starts executing P1
At time 4,P2 arrives. Now ready queue contains P2.
At time 5, a context switch occurs as the time quantum is 5 and P1 is added to ready queue.
Now ready queue contains P1,P2.
Now P2 starts executing. So the ready queue now contains P1.
At time 10,P3 arrives. Now ready queue is P3,P1.
P2 also finishes execution at time 10.
Now a context switch occurs and process P1 starts executing,since P1 is the first process in ready queue.Now ready queue is P3.
At time 12, the process P1 will go for an I/O operation.Now ready queue is P3.
So P3 starts executing at 12.Now ready queue is empty.
At time 14, P4 arrives.Now ready queue is P4.
At time 17,P1 finishes I/O operation and P1 is added to ready queue. Now ready queue is P1,P4.
At that time P3 finishes executing.Since P3 needs 4 time units more, P3 is added to ready queue.
Now a context switch occurs and process P4 starts executing,since P4 is the first process in ready queue.Now ready queue is P3,P1.
P5 arrives at time 21.Now ready queue is P4,P3,P1.
Now balance two units of P1 is executed. Now ready queue is P4,P3.
Then balance 4 units of P3 is executed.
Now the remaining process is P5.It will be executed

The Gantt chart is

Response time is the time spent when the process is in the ready state and gets the CPU for the first time.

Waiting time is the total time spent by the process in the ready state waiting for CPU.

Add a comment
Know the answer?
Add Answer to:
question is based on operating system concept. round roubin algorith 4 5 6 Use Round Robin...
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
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