Page 1 of 1

Any possible way ?

Posted: Mon Oct 24, 2005 2:29 pm
by SoftEnough;-)
hello
is there is any possible way to decide which task runs during the return from the interrupt.
most schedules decides which process will run next by updating tss with kstack of the next process, but is there is any way to decide which process will run now during the interrupt ? i hope u understood me :-\

Re:Any possible way ?

Posted: Mon Oct 24, 2005 2:44 pm
by distantvoices
Hai Softie :-)

That's pretty simple:

You have a scheduler, which does the round robin thing f. ex. you have events which cause a task to block/unblock.

and at the bottom of that, ere the isr or software isr is returned to, you have a small function, which picks the next runnable task be it the already running one, be it another one (preempting the previous one) never mind: This function looks at the head of your queues of runnable tasks (per priority one queue) from highest to lowest. the runnable task might be referenced to by putting a pointer to it in a global variable like running_task.

From this variable running_task, your isr-leave stub may restore the running task's context.

For further reference you might have a look at www.distantvoices.org/html/multitasking.html

HTH & ccw