Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Round-robin scheduling
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Process scheduling== {{anchor|Process schedulling}} <!-- Former section name --> To [[Process scheduler|schedule processes]] fairly, a round-robin scheduler generally employs [[time-sharing]], giving each job a time slot or ''quantum''<ref name = "McConnell2004">{{cite book | title = [[Operating System Concepts]] | last1 = Silberschatz | first1 = Abraham | author-link1 = Abraham Silberschatz | last2 = Galvin | first2 = Peter B. | last3 = Gagne | first3 = Greg | year = 2010 | publisher = [[John Wiley & Sons]] (Asia) | isbn = 978-0-470-23399-3 | chapter = Process Scheduling | quote = 5.3.4 Round Robin Scheduling | edition = 8th | pages = 194 }}</ref> (its allowance of CPU time), and interrupting the job if it is not completed by then. The job is resumed next time a time slot is assigned to that process. If the process terminates or changes its state to waiting during its attributed time quantum, the scheduler selects the first process in the ready queue to execute. In the absence of time-sharing, or if the quanta were large relative to the sizes of the jobs, a process that produced large jobs would be favored over other processes. Round-robin algorithm is a pre-emptive algorithm as the scheduler forces the process out of the CPU once the time quota expires. For example, if the time slot is 100 milliseconds, and ''job1'' takes a total time of 250 ms to complete, the round-robin scheduler will suspend the job after 100 ms and give other jobs their time on the CPU. Once the other jobs have had their equal share (100 ms each), ''job1'' will get another allocation of [[CPU]] time and the cycle will repeat. This process continues until the job finishes and needs no more time on the CPU. * '''Job1 = Total time to complete 250 ms (quantum 100 ms)'''. # First allocation = 100 ms. # Second allocation = 100 ms. # Third allocation = 100 ms but ''job1'' self-terminates after 50 ms. # Total CPU time of ''job1'' = 250 ms Consider the following table with the arrival time and execute time of the process with the quantum time of 100 ms to understand the round-robin scheduling: {| class="wikitable" style="margin: 1em auto 1em auto;" |- ! Process name !! Arrival time !! Execute time |- | P0 || 0 || 250 |- | P1 || 50 || 170 |- | P2 || 130 || 75 |- | P3 || 190 || 100 |- | P4 || 210 || 130 |- | P5 || 350 || 50 |} [[File:RoundRobin.jpg|center|400px|Round Robin Scheduling]] Another approach is to divide all processes into an equal number of timing quanta such that the quantum size is proportional to the size of the process. Hence, all processes end at the same time.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)