A scheduler being a system program must be scheduled for execution so that it can wake up and schedule other programs. I read about process scheduling and algorithms but couldn't figure out how a scheduler itself is scheduled.
Does it schedule itself ? if yes then how ? and what algorithm ? because it should be waking up more often than any other program so there must be a different algorithm I think.

I have a LOT many similar questions in mind but all of them relate to just one thing, How a scheduler itself is scheduled ?

  • just to clarify, you are only really speaking of multi-thread/process scheduling, not task schedulers like cron, at, or the the windows task scheduler, right? – Frank Thomas Nov 24 '13 at 20:39
  • @Frank, yes, In speaking of multi thread/process scheduling. – Gufran Nov 25 '13 at 3:48

There are multiple approaches to that problem.

Cooperative Multitasking Schedulers

A cooperative scheduler is invoked every time a program invokes it or yields control to it. It cooperates with the operating system and other running programs. A program that never yields, e. g. a “hanging” process, will never leave the running state on a machine with a single CPU.

Preemptive Multitasking scheduler

A very simple preemptive scheduler is invoked periodically by a timed CPU interrupt. A program cannot prevent this (without system level privileges) and will leave the running state because the CPU repositions the instruction pointer during interrupts.

I suggest you read the Wikipedia article on multitasking.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.