Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] using rusage



Josh Glover wrote:
2008/6/20 Curt Sampson <cjs@example.com>:
And why do you think nanosleep will get you closer than sleep?

Again, from Stevens (if my flaky memory serves), I seem to remember
that some Unices gave you worse resolution for sleep(3) than for
usleep(2) or nanosleep(3).

Well the relevant Stevens quotes would be from 10.19. sleep Function

"As with an alarm signal, the actual return may be at a time later than requested, because of other system activity."

"FreeBSD 5.2.1, Linux 2.4.22, and Mac OS X 10.3, on the other hand, use another technique: the delay is provided by nanosleep(2)."

Even if the resolution where higher there is no guarantee that it will be scheduled immediately after becoming runnable.

Edward


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links