[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Short sleeps.



Mads Bondo Dydensborg wrote:
> 
> On Fri, 11 Jan 2002, Steve Baker wrote:
> 
> > > Amd, looking at my FIrst Edition of Linux Device Drivers, on page 137, there
> > > is mention of the udelay() function, which is pretty high resolution, BUT, it
> > > blocks. The books says that there are no functions (or fails to mention
> > > functions) for such high resolution delays.
> >
> > I don't see a 'udelay' in any modern Linux docs.
> 
> Its a kernel thing.
> 
> Please Steve, couldn't you explain a bit more about what you are trying to
> do? I am really curious. It may even help me/someone to come up with a
> solution.

Well, I have a piece of hardware that has to be polled to see if it has
some information for me.  The main process is doing 'normal' computational
gamesy things at 60Hz update rates - but the parallel thread needs to check
the hardware every couple of milliseconds or so - continually.

Hence, the hardware thread must not busy-wait because if it does, the main
program won't run at all.

Unfortunately, I cannot discuss the nature of the hardware that I'm polling.

Probably, what I'll have to do is just make the main thread do all the
work, testing the clock during all the big loops to be sure I don't miss
anything.  That's just a really *ugly* solution and I'd prefer to use a
short duration 'sleep'.

----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1@airmail.net>   WorkMail: <sjbaker@link.com>
URLs : http://www.sjbaker.org
       http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
       http://prettypoly.sf.net http://freeglut.sf.net
       http://toobular.sf.net   http://lodestone.sf.net