Any possible way ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
SoftEnough;-)

Any possible way ?

Post 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 :-\
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Any possible way ?

Post 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
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply