This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to implement EDF scheduling in eCos


Hi,

On Thursday 20 October 2005 17:04, Nick Garnett wrote:
...
> In theory this would be done by making threads wait until their start
> time and running an EDF scheduler on the set of available
> threads. We even have the start of an EDF API in kapi.h:
>
> /* Deadline scheduling control (optional) */
>
> void cyg_thread_deadline_wait(
>     cyg_tick_count_t    start_time,             /* abs earliest start time 
>  */ cyg_tick_count_t    run_time,               /* worst case execution
> time */ cyg_tick_count_t    deadline                /* absolute deadline   
>      */ ) __THROW;
>
> Any thread calling this will wait until the start_time and then expect
> to receive run_time ticks of execution time before the deadline time
> is reached. Execution is given to the thread by returning from this
> function and it signals the completion of its execution by calling it
> again.
...
> So, eCos was designed with the idea that an EDF scheduler was a
> possibility. The scheduler is deliberately separate from the basic
> thread mechanisms so such a thing could be done. However, as far as
> implementing an EDF scheduler in eCos now is concerned, I suspect that
> dependencies on having a straightforward prioritized scheduler are a
> little too ingrained in the code. It might be possible to get just
> the kernel running with EDF, so long as things like mutex priority
> inheritance are disabled. Obviously POSIX will not work, and the
> TCP/IP stack is unlikely. Other subsystems will probably either work
> fine, if they don't do anything with threads, or fail miserably.

Maybe it could be implemented as an extension to the multilevel scheduler ? 
E.g. the top priority could be reserved for EDF threads, and all other (lower 
priority) threads will be scheduled as it is now.
With the multilevel scheduler AFAIK round robin is used if there are several 
threads with the same priority ready to tun. With EDF the deadline 
information could be used to decide which thread to run. Since the EDF 
threads would all have the top priority, the other threads wouldn't interfere 
it.
Obviously stuff which expects "normal" scheduling, e.g. the TCP/IP stack, 
couldn't be set to EDF scheduling but would have to run in not-top-priority 
threads. So only a limited set of function calls would be available in EDF 
threads.

Bye
Alex
-- 
Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de
Home: neundorf@kde.org                - http://www.kde.org
      alex@neundorf.net               - http://www.neundorf.net

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]