Process Scheduling
In order to schedule processes fairly, a round-robin scheduler generally employs time-sharing, giving each job a time slot or quantum (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. 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 favoured over other processes.
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
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.
Read more about this topic: Round-robin Scheduling
Famous quotes containing the word process:
“You can read the best experts on child care. You can listen to those who have been there. You can take a whole childbirth and child-care course without missing a lesson. But you wont really know a thing about yourselves and each other as parents, or your baby as a child, until you have her in your arms. Thats the moment when the lifelong process of bringing up a child into the fold of the family begins.”
—Stella Chess (20th century)