O(n) scheduler

The O(n) scheduler[1] is the scheduler used in the Linux kernel between versions 2.4 and 2.6. Since version 2.6, it has been replaced by the O(1) scheduler and later by the Completely Fair Scheduler (CFS).

Location of the "O(n) scheduler" (a process scheduler) in a simplified structure of the Linux kernel.

Algorithm

This scheduler divides processor time into epochs. Within each epoch, every task can execute up to its time slice. If a task does not use all of its time slice, then the scheduler adds half of the remaining time slice to allow it to execute longer in the next epoch.

Advantages

This scheduler was better in comparison to the previously used very simple scheduler based on a circular queue.

Disadvantages

If the number of processes is big, the scheduler may use a notable amount of the processor time itself. Picking the next task to run requires iteration through all currently planned tasks, so the scheduler runs in O(n) time, where n is the number of the planned processes.

gollark: As far as I can tell, not that I'm deep into ceramic lore, DS is a real person with access to chatbots.
gollark: Because if a bot is added with any permissions, it gets an unremovable (unless you kick and readd it) role.
gollark: * 250 role limit
gollark: The 250 role was very annoying on one server I manage.
gollark: It's probably a markov chain, the laziest possible textgen "AI".

See also

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.