# OS:- Round Robin scheduling

1.6k views
If we have only one process in ready queue with burst time "m", then how many context switching will happen using round robing scheduling with time quantum q ,where q<m.Assume that dispatching the process first time is not counted as  a context switch.
1
m/q if we are considering last context switch otherwise m/q-1.
2
For one process does context switch happen? Saving and loading same process :o
0
Short term scheduler schedules process from ready queue to CPU and dispatcher changes the context which is on the disk so I don`t think they will ever come to know that it's the same process under round robin scheduling ! what do you think?
0
Theocratically i think you are right. I thought the same way.But i am not able to convince myself:(
1
1
what will happen if there are n processess is it $(m/q)^{n}$????.correct me if i am wrong.
0
but don't you think that once the process starts executing then the ready queue will be empty as there is only one process in the system?
0
i think only 0 Context switching

It clearly says " .Assume that dispatching the process first time is not counted as  a context switch."

so number of context switch = 0

as there is only one single process.

selected by
1
Sir, but in galvin under the topic of RR there as diagram which shows that CS can take place with just one process too.
It will not context switch since only one process is there . So ans is 0.
0

ROUND ROBIN Single Process - Number of Context Switches

In Operating System Concepts, Galvin, Ed. 9th, page 273, below figure 6.4. (Section 6.3.4 Round-Robin Scheduling) Paragraph says that -

Assume, for example, that we have only one process of 10 time units. If the quantum is 12 time units, the process ﬁnishes in less than 1 time quantum,with no overhead.

If the quantum is 6 time units, however, the process requires 2 quanta, resulting in a context switch. If the time quantum is 1 time unit, then nine context switches will occur, slowing the execution of the process accordingly(Figure6.4).

Clearly, Book doesn't count first time and last time as context switches (if question doesn't mention anything whether to take or not in that case, default mode). In single process, round robin scheduling, they are counting context switches after time quantum expires.

Well, I think it is implemented code. Different implementation can have different things and they can modify algorithm or improve it for performance.

Now for actual question.

burst time is - m units (let 10) ,  time quantum - q units (let 5 or 6 or 4) , q<m

$\left \lceil \frac{m}{q} \right \rceil - 1$

## Related questions

1
596 views
Choose correct answer from the below options: If the following jobs are to be executed on a single processor system The jobs are arrived at time 0 and in the order a, b, c, d, e. Calculate the departure time (completion time) for job ‘a’ if scheduling is round robin with time slice 1 15 5 9 11
1 vote