--- In AVR-Chat@yahoogroups.com, Dave VanHorn <dvanhorn@d...> wrote: > ... in your case [ECROS], a timer schedules > your re-evaluation of which tasks should be > running/queued. During that timer int, you > do what I do, in that you examine semaphores > to see what's ready, what's done, what's empty, > etc.. (pre-emptive multitasking?) I hope I'm not getting this thread mixed up. Assuming you were still replying to me, Dave, the answer is no, the ECROS kernel is cooperative, like yours. So, the OS adds tasks to queues only when events make them ready and once added they make their way to the head until they are removed and run. > In my case, I run a task to completion, with > an eye to completing it as soon as possible. Same with ECROS. A task has a function associated with it and it yields the CPU by returning from that function. The function bound to the task can be changed at run time, which makes for very neat state machines. > When any task ends, then in the case of a > round-robin, the next task tries to run. > If it can't proceed for whatever reason, > then I pass to the next task, and so on. The ECROS scheduler just goes back to examining the queues. It will never meet a task that is not ready to run as such a task will not be in a queue. I have no strict round-robin, but first-come-first-served queuing within a priority level has a similar effect. > Interrupts, in my case, are either a system > timer (clock-ish timekeeping) or physical events. Same with ECROS. > I arrange the order of my tasks in the > round-robin system such that the low > level functions happen first, then the > higher levels, because the higher levels > depend on events that happen in the lower > levels. ECROS supports multiple task priorities with any number of tasks at any given priority so the ordering of execution is fully dynamic. > Alternately, I can re-start from the > beginning in which case high priority > tasks (those that sit early in the idle > loop) can prevent lower priority tasks > from running by chewing up all the time. In ECROS it is also possible for high priority tasks to lock out the low priority ones. I don't know that this needs fixing in the OS. If this happens, it's probably the application that's at fault. If a task hogs the CPU for too long in a single stretch, ECROS resets the system using the watchdog timer. Graham.
Message
ECROS (was Re: Teenagers ...)
2004-09-07 by Graham Davies
Attachments
- No local attachments were found for this message.