lkml.org 
[lkml]   [1999]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mdelay question
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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.057 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site