Re: sleep() API behaves different between 2.4 and 2.6

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

 



On Wed, Feb 28, 2007 at 02:32:43AM -0800, Bizhan Gholikhamseh (bgholikh) wrote:
> I have a simple program utilizing "sleep()" api to sleep 3 msec
> periodically.
> I measured the time difference before calling the api and after it
> returns back.
> The same application behaves differently running on Linux 2.4 and 2.6
> In Linux 2.6.11, it takes about 3 msec, and running on Linux 2.4.20 it
> takes about 10 msec.

Your 2.6 kernel probably runs with HZ=1000. 2.4 kernels run with
HZ=100, so the minimum sleep time is actually 1/HZ = 10 msec.

Note that with any userland sleep function, the wanted sleep time is a
minimum and not a guarantee that you will be woken up right after the
wanted sleep time.


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux