lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 17 Aug 2007 09:54:46 +0200 (CEST)
From:	Jan Engelhardt <jengelh@...putergmbh.de>
To:	GolovaSteek <golovasteek@...il.com>
cc:	Michal Schmidt <xschmi00@...d.feec.vutbr.cz>,
	linux-kernel@...r.kernel.org
Subject: Re: nanosleep() accuracy


On Aug 17 2007 11:44, GolovaSteek wrote:
>> How do you measure this?
>> If you want to have something done every 300 microseconds, you must not
>> sleep for 300 microseconds in each iteration, because you'd accumulate
>> errors. Use a periodic timer or use the current time to compute how long
>> to sleep in each iteration. Take a look how cyclictest does it.
>
>no. I just want my programm go to sleep sometimes and wake up in correct time.

Would it be acceptable to use an optimistic strategy, like the one below?

Let's say that the following tasks happen at each time: A at 0, B at 300, C at
600, D at 900, E at 1200, F at 1500. Assume sleeping takes 500 µs.
Then B and C could be run at 500, D at 1000 and E,F at 1500.


	Jan
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ