This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: : Is eCos Hard Real Time OS ??
On Fri, Jun 24, 2005 at 06:22:20PM +0530, R. Vamshi Krishna wrote:
> >You have to think, what exactly does hard real time mean to you? Do
> >you need 80.000% and 20.000% or will 78.1% and 19.2%, plus some lost
> >to interrupts be OK? Does the system have to be completely
> >deterministic or is some randomness in timing allowed?
> >
> >
> Yeah, Interrupts are fine ..
So does that mean an interrupt storm is OK? Some hardware is broken
and generates many interrupts which can take up 100% if the CPU for a
while.....
> Actually this is problem statement to some extent ...
>
> There are various threads, say p1,p2,p3 ...
>
> now p1 has actual execution time of 5 msec.
> p2 has actual execution time of 11 msec.
> p3 has actual execution time of 18 msec.
>
> Now I set the periodicity of these 3 threads as 50msec.
>
> What I mean is that I divide the time into 50 msec blocks and
> I need to run the thread once in every 50 msec block.
>
> the slack time of 16 msec left can be used to service interrupts or
> other chores but, I need to run the threads once every 50 msec.
So you probably want two layers of scheduler. The want your hard
schedular and the standard soft schedular. The hard schedular calls
the soft schedular when it has nothing to do.
When the hard schedular and its tasks are running you disable
interrupts. You have to decide how to handle a hard task taking too
long. There is no simple answer to this. To some extent its a policy
decission. You could simply allow it, or you could kill the thread so
it never runs again, or you could reboot hoping it magically fixes
itself.
You also have to somehow handle soft threads disabling interrupts for
too long so that your 50ms timer does not arrive until its too
late.
You also have interesting problems with synchronisation betweem soft
and hard threads.
There are lots of problems to consider, but most of them are not
new. I suggest you go look at other OS's that support hard real time,
look at conference papers and journal papers etc. Find out the normal
solutions to these problems and see how you can adapt them to eCos.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss