Linux nanosleep investigation.

Andrea Arcangeli andrea@suse.de
Wed Feb 16 14:06:00 GMT 2000


[ I just noticed a silly bug in my patch (I am returning the
  elapsed time not the remaining time!). sorry, I'll post a new one
  ASAP). ]

On Wed, 16 Feb 2000, Kevin Hendricks wrote:

>The real issue here is that if nanosleep is constantly being interrupted
>by numerous signals almost immediately after it gets entered and you add
>that one extra jiffee in rounding up, could the remaining time that is
>returned theoretically be larger than the initial time requested or show
>no elapsed time at all?

I can handle this correctly I think. That was the object of my patch.

>Kaz, given your arguments, we will have to simply keep track of time using
>gettimeofday in pthread_cond_timedwait and that is fine since it is passed an
>absolute timeout anyway, this is not an issue.

You won't need to use gettimeofday, but you'll only need to look at the
second argument of nanosleep. That's the whole point of my patch.

Andrea



More information about the Libc-alpha mailing list