the scheduler is an asynchronous kernel code.
it is *not* a process. it is not always running.
it is invoked (specifically, scheduler_tick() is) HZ times in a second
by the timer interrupt. this value is somewhere between 100 to 1000 times
a second, depending on your kernel version.
when invoked, amongst other things, it decrements the currently
running process's timeslice, and if needed it sets the need_resched variable.
this variable means that a rescheduling is needed.
just before the kernel returns back to user space (from interrupt or system call)
it checks this variable, and if set, there is a context switch of processes.
this is in very short the essence of the scheduler. of course there's a lot more
i didn't mention (algorithms, data structures, kernel preemption) - you may want
to grab a book about this.
Cheers,
Ohad.
On 5/13/06, Sun Agham <agham.sunil@xxxxxxxxx> wrote:
in an operating system, a schedular shedules all the processes but what exactly is a schedular, its a process only (as there are different scheduling algorithms). who schedules the schedular ? how is it implemented in hardware ? the question is not very specific but please help me understand the concept .