written 5.6 years ago by | • modified 5.6 years ago |
First in first out
Round-robin algorithm
Round robin with priority:
Shortest job first
Non Pre-emptive multitasking
Pre-emptive multitasking
Round robin algorithm
In the round robin algorithm, the kernel allocates a certain amount of time for each task waiting in the queue .the time slice allocated to each task is called quantum.
As shown in fig .if three tasks 1,2, 3 are waiting in the queue the CPU first executes task1 then task2 then task 3 and the again task1 in round robin algorithm each task waiting in the queue is given a fixed time slice .
The kernel gives control to the next task if the current task has completed its work within the time slice or if the current task has completed it allocated time
The kernel gives control to the next task if
$\hspace{1.5cm}$a) the current task has completed within the time slice
$\hspace{1.5cm}$b) the current task has no work to do
$\hspace{1.5cm}$c) the current task has completed its allocated time slice
- This algorithm is very simple to implement but there is no priorities for any task. All tasks are considered of equal importance .if time critical operation are not involved then this algorithm will be sufficient, digital miltimeter , microwave oven has this algorithm .