Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Feb 2008 15:47:09 +0100
From:      "Heiko Wundram (Beenic)" <wundram@beenic.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: usleep
Message-ID:  <200802251547.10068.wundram@beenic.net>
In-Reply-To: <20080225131546.0d9d2f22@gumby.homeunix.com.>
References:  <200802221558.42443.sharadc@in.niksun.com> <200802251039.59767.wundram@beenic.net> <20080225131546.0d9d2f22@gumby.homeunix.com.>

next in thread | previous in thread | raw e-mail | index | archive | help
Am Montag, 25. Februar 2008 14:15:46 schrieb Robert Woolley:
> On Mon, 25 Feb 2008 10:39:59 +0100
> "Heiko Wundram (Beenic)" <wundram@beenic.net> wrote:
> > Am Montag, 25. Februar 2008 10:10:56 schrieb Sharad Chandra:
> > > So does it mean, freebsd has limitation. sleeping will only work
> > > for its value more than 1 milli sec because % of +- error value is
> > > comparitivly low? I am curious to know, is there any method which
> > > sleeps for few microseconds. Some one please give me link where to
> > > look for "select".
> >
> > No, this does not mean that FreeBSD has a limitation, but rather that
> > FreeBSD is not a real-time operating system. You'll see the similar
> > behaviour on pretty much any other operating system that is _not_ a
> > RTOS
>
> It's actually not a distinguishing feature of RTOSs. I haven't worked on
> them for a few years, but when I did, both pSOS and VxWorks had this
> limitation. The important thing is that RTOSs handle interrupts
> well. In traditional real-time software, sleeping is something that
> happens in non-critical background tasks.

When you read what I wrote in detail, I just said that he should expect to see 
the "sliced sleeping" behaviour on pretty much any operating system that is 
not an RTOS, but didn't say that for an RTOS he should expect exact sleeping 
(the old "all Spartans are Greeks, but not all Greeks are Spartans" thingy). 
At least that's what I wanted to say, but I can see that the first sentence 
might have been slightly misleading wrt. to my intention.

Anyway, as a uni project, I had to implement a minimalistic RTOS for an 
integrated CPU which had the requirement to sleep more or less exactly 
(because of timing hardware accesses and sensor data acquisition with the 
sleeps without having interrupts from the external hardware), but I know that 
this isn't a distinguishing feature.

-- 
Heiko Wundram
Product & Application Development



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802251547.10068.wundram>