Mailing List archive

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

[vdr] usleep question.



AFAIK, the Linux scheduler interval is 10 ms
and all usleep calls between usleep(1) and
usleep(10000) have the same effect.
So I wonder why we find usleep(1) calls so
often. If the scheduler interval will ever
be reduced in future operating system versions,
will that not turn programs that use these
fantastic low usleep values into CPU-hogs
or even make them fail because they really
depend of the fact that usleep(1) sleeps for
longer than a MICROsecond?
After all, there are a million microseconds in 
a second! ;-)

Also, the usleep man page says:
       This function is obsolete.
       Use nanosleep(2) or setitimer(2) instead.
And the nanosleep man page says:       
       Compared  to ... usleep(3),  nanosleep 
       ... provides higher timing resolution

Can anyone clarify what exactly is going on?

Carsten.



Home | Main Index | Thread Index