From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2997 invoked by alias); 24 Jun 2005 13:32:37 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 2926 invoked by uid 22791); 24 Jun 2005 13:32:24 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 24 Jun 2005 13:32:24 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1DloHu-00041r-00; Fri, 24 Jun 2005 15:32:06 +0200 Date: Fri, 24 Jun 2005 13:32:00 -0000 To: "R. Vamshi Krishna" Cc: ecos-discuss@sources.redhat.com Message-ID: <20050624133206.GD7187@lunn.ch> Mail-Followup-To: "R. Vamshi Krishna" , ecos-discuss@sources.redhat.com References: <20050624112732.GA7187@lunn.ch> <20050624123829.GB7187@lunn.ch> <42BC0204.5080900@cse.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42BC0204.5080900@cse.iitb.ac.in> User-Agent: Mutt/1.5.9i From: Andrew Lunn Subject: Re: [ECOS]: Is eCos Hard Real Time OS ?? X-SW-Source: 2005-06/txt/msg00242.txt.bz2 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