Re: Cooperative multitasking OS-??
- From: Arlet Ottens <usenet+5@xxxxxxxxxx>
- Date: Fri, 30 Nov 2007 10:45:14 +0100
ssubbarayan wrote:
Dear experts,
Sorry if this sounds novice.I would like to really understand whats
meant by Cooperative multitasking OS?I read another thread in this
group which was explaining about the advantages and disadvantages it
has over a preemptive system.
From what I understood going through the discussion,Cooperative to me
looks like FIFO scheduling mechanism.
Can any of you throw some light on this or provide some links to
understand about this concept?I hit google and wikipedia but did not
get a satisfactory explaination.
Wikipedia IIRC says,Cooperative multitasking systems existed during
pre win9xOS days and non existant almost in current scenerio.Is this
true?
How different is this Cooperative system from roundrobin or FIFO?How
does the OS kernel decide which task/process to promote at any point
of time?
What sort of applications need cooperative functionality?
I don't know if everybody uses the same definition, but I've recently implemented what I call a cooperative scheduler. Just like a preemptive scheduler, there's a list of tasks with priorities. When the scheduler is called, it picks the runnable task with the highest priority to run.
The only real difference with a preemptive kernel is that the selected task will run until it blocks itself and calls the scheduler again. If an interrupt unblocks a higher priority task, it will have to wait. This requires some discipline from the programmer to make sure none of the tasks run for excessive amounts of time between two calls to the scheduler.
The advantage is that you don't to worry about shared data between tasks. The only time you need to use semaphores is when you actually want to sleep in a critical section. Priority inversion is also less of a problem. For me, an additional advantage is that it requires less memory to save the context (i.e. the stack), because tasks are only switched at well defined points.
The disadvantage is of course that high priority tasks don't always get to run right away. In some cases, this can be mitigated by doing more in the interrupt handler itself, such as putting incoming data in a FIFO.
.
- References:
- Cooperative multitasking OS-??
- From: ssubbarayan
- Cooperative multitasking OS-??
- Prev by Date: Re: 300 mA from a microcontroller pin
- Next by Date: Why does portmap daemon run when i start multiice server?
- Previous by thread: Cooperative multitasking OS-??
- Next by thread: Re: Cooperative multitasking OS-??
- Index(es):
Relevant Pages
|