From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Kaiser Subject: Re: [PATCH] add timeouts to mini-os Date: Mon, 2 Oct 2006 10:02:20 +0200 Message-ID: <200610021002.20818.rkaiser@sysgo.com> References: <200608291442.50081.kaiser@informatik.fh-wiesbaden.de> <200610010118.15960.kaiser@informatik.fh-wiesbaden.de> <8B56473E-DEFD-4010-ABD5-4E1931C4BD2F@cam.ac.uk> Reply-To: rkaiser@sysgo.com Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <8B56473E-DEFD-4010-ABD5-4E1931C4BD2F@cam.ac.uk> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Grzegorz Milos Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi Gregor Am Sonntag, 1. Oktober 2006 20:38 schrieb Grzegorz Milos: > Hi Robert, > > Having timeout timers in MiniOS would be very useful indeed (I had a > few people asking about that already). > > Timers in Xen and Linux are a bit different then your implementation > for MiniOS (inspect xen/common/timer.c and /kernel/timer.c for > more detail). The way that Linux/Xen handles timers is slightly more > flexible, however the functionality that you could put in Mini-OS > timer handler is very limited (you can only wake up a thread/set of > threads really). Which functionalities would you like to see that are currently missing? > I think we can therefore stick to this solution for > now. I'll have a look through the code tomorrow, and let you know if > I have any comments. Thanks. (There are few shortcomings of my implementation that I'm well aware of myself. For instance, I think it would be more efficient to unlink blocked threads from the ready queue and keep the ones with pending timeouts in a "timeout" queue, sorted by ascending expiry date. That way, it wouldn't be necessary to walk the entire ready queue all the time to see if any timeouts have expired: it would suffice to just look at the head of the timeout queue. However, my goal was to keep things simple and to not change more than absolutely necessary.) Cheers Rob > > Thanks. > Gregor > > On 1 Oct 2006, at 00:18, Robert Kaiser (FH) wrote: > > Hi Gregor, > > > > attached is a patch to mini-os. It removes the debug print of > > current time > > (which didnt work anyway) and adds support for timed sleeps. The > > application > > code now has a thread which is activated periodically (once every > > second) by > > means of the new sleep function and prints out the current time, so > > the > > program now actually does what the README says. The idle thread now > > blocks as > > long as necessary (i.e. until the nearest timeout expires) instead > > if the > > fixed 10 seconds as before. > > > > Please review it and consider for inclusion. > > > > Cheers > > > > Rob > > -- Robert Kaiser SYSGO AG Office Mainz Am Pfaffenstein 14 / D-55270 Klein-Winternheim / Germany Tel.: +49-6136-814791 / Fax: +49-6136-9948-10 Email: robert.kaiser@sysgo.com / Web: http://www.sysgo.com