search
Log In
5 votes
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.
in Operating System 1.6k views
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
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

3 Answers

5 votes
 
Best answer
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.
3 votes
It will not context switch since only one process is there . So ans is 0.
2 votes

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

But the other answers or comment based on this link.

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

0 votes
1 answer
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
asked Dec 10, 2017 in Operating System Parshu gate 596 views
1 vote
1 answer
2
974 views
How many time context switch in Round Robin? ( if only one process remain in ready queue at end of scheduling does that count every time, when time slice over or only one time?)
asked Jan 7, 2017 in Operating System sanyam53 974 views
3 votes
2 answers
3
1k views
Consider a System using Round Robin scheduling with 10 Processes all arriving at the time 0. Each Process is associated with 20 identical Request. Each Process request consumes 20 ms of CPU time after which it spends 10 ms of time on I/O,thereafter intiates subsequent ... Process. ii. Response time of the 1st Request of the last Process. iii. Response time of the subsequent request of any process.
asked Aug 22, 2018 in Operating System Karan Dodwani 1 1k views
6 votes
1 answer
4
4.1k views
Measurements of a certain system have shown that a process runs, on the average, for time T before blocking for Input/Output. Process switch requires time S which is overhead. For round robin scheduling with quantum Q, give a formula for the cpu efficiency in each of the ... goes to 0 Can somebody please explain option c and hence option D with example ,Thanks and sorry if it is naive question :)
asked Nov 15, 2017 in Operating System sunil sarode 4.1k views
...