Scheduler schedules itself too?
Posted: Sat Oct 08, 2011 8:53 am
I can not imagine how the scheduler really works.
It schedules and manages the threads/processes in sequence and knows also about for example how long
to wait for one process and so on. Is that true that Scheduler schedules itself too?
is there a circuit like this:
thread1()
scheduler()
blabla()
scheduler()
blabla
scheduler()
?
Timer Interrupt
for example: if one thread or whatever say wait 30 seconds, the scheduler knows now he has to wait 30 seconds, and the actual time
is 10 + 30 = 40(time to wake this thread again)
There is a little problem, what will happen if the timer interrupt is disabled in this stage for a while, the time isn't true any more
because you lose time(let's say 5 seconds) when the timer does not increment any more.
Can you help me please?
Thanks before
It schedules and manages the threads/processes in sequence and knows also about for example how long
to wait for one process and so on. Is that true that Scheduler schedules itself too?
is there a circuit like this:
thread1()
scheduler()
blabla()
scheduler()
blabla
scheduler()
?
Timer Interrupt
for example: if one thread or whatever say wait 30 seconds, the scheduler knows now he has to wait 30 seconds, and the actual time
is 10 + 30 = 40(time to wake this thread again)
There is a little problem, what will happen if the timer interrupt is disabled in this stage for a while, the time isn't true any more
because you lose time(let's say 5 seconds) when the timer does not increment any more.
Can you help me please?
Thanks before