Re: mdelay question

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Fri, 26 Mar 1999 11:03:20 +0000 (GMT)


On Fri, 26 Mar 1999, Alan Cox wrote:

> > a sigifigant time (ie, 0.25 to 1 second) if you haven't disabled
> > interrupts? ie, will you completely monopolize the cpu, or will the
> > scheduler kick you off until sometime shortly after the delay runs out?
>
> If you want more than about 1/100th of a second use a loop yielding CPU
> time. Better yet sleep and wakeup if your card can IRQ the event
>
> At minimum
>
> unsigned long time=jiffies+(msec*HZ)/1000;
> while(time_before(time, jiffies))
> schedule();
>
> or in an irq/bh set a timer to go off

Don't we now have schedule_timeout() to do this?

Matthew.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/