lkml.org 
[lkml]   [1999]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Can't sleep less than 20 ms
Andrea Arcangeli wrote:
>
> On Thu, 1 Jul 1999, Dong Liu wrote:
>
> >I know Linux on i386 has a timer resolution of 10 ms, but
> >why I can't sleep for 10 ms, I can only sleep at
> >interval of 20 , 30, 40 ... ms.
> >
> >This what happpends
> >
> >usleep ( <= 10*1000) will sleep for 20 ms
> >usleep ( <10*1000 <= 20*1000) will sleep for 30 ms
> >usleep ( <20*1000 <= 30*1000) will sleep for 40 ms
> >
> >I'm runing 2.2.10.
>
> Set the policy of the scheduler as RT.
>

It works only when sleeping less than 2 ms, and the kernel actually
does a busy loop. Since the timer resolution is 10ms, I expect
I should be able to sleep (give up CPU) for 10ms.

Dong

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