10,017 views
13 votes
13 votes

Suppose a system contains $n$ processes and system uses the round-robin algorithm for CPU scheduling then which data structure is best suited ready queue of the process

  1. stack
  2. queue
  3. circular queue
  4. tree

2 Answers

Best answer
18 votes
18 votes

Circular queue is the best data structure for round-robin CPU scheduling algorithm .

In round-robin CPU scheduling if the timer goes off first, then the process is swapped out of the CPU and moved to the back end of the ready queue.

The ready queue is maintained as a circular queue, so when all processes have had a turn, then the scheduler gives the first process another turn, and so on.

So option C is correct.

selected by
3 votes
3 votes
Yes, it should be Circular Queue.

Since it is given that there are n processes in the ready queue, we do not have to worry about the overflow in the circular queue also.
Answer:

Related questions

11 votes
11 votes
10 answers
1
ajit asked Oct 12, 2015
11,064 views
Suppose two jobs, each of which needs $10$ minutes of CPU time, start simultaneously. Assume $50\%$ I/O wait time. How long will it take for both to complete, if they run...
7 votes
7 votes
2 answers
2
go_editor asked Jun 19, 2016
3,818 views
Consider the following program.main() { fork(); fork(); fork(); }How many new processes will be created?8675
12 votes
12 votes
4 answers
3
go_editor asked Jun 17, 2016
3,820 views
In a lottery scheduler with 40 tickets, how we will distribute the tickets among 4 processes $P_1, P_2, P_3$ and $P_4$ such that each process gets 10%, 5%, 60% and 25% re...
6 votes
6 votes
2 answers
4
go_editor asked Jun 17, 2016
10,795 views
If there are 32 segments, each size 1 k bytes, then the logical address should have13 bits14 bits15 bits16 bits