lkml.org 
[lkml]   [1999]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q: waiting for a short time and not beeing a resource hog
Quoting Jens Axboe (axboe@image.dk):
> On Wed, Dec 01 1999, Andreas Schuldei wrote:
> > I do not like the
> > while( (jiffies-time_start) < 1 );
> > since it is too long and blocks the whole cpu from doing sensible stuff.
> > static void jiffy_sleep(u_int time)
> > current->state = TASK_INTERRUPTIBLE;
> > current->timeout = jiffies + time;
> > schedule();
> > Is this still applicable and racecondition-save?
> Not in an interrupt context. Basically you can't sleep or
> schedule inside an interrupt handler. How long do you need
> to wait?

for 50 us (10000 ticks on a 200MHz machine).

Is
schedule_timeout(ticks)

any better? I see it beeing used quite a lot in nowerdays kernels

-
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:55    [W:0.059 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site