There seem to be two issues with nanosleep.

The first is a lack of information in the man page.  It would be useful to know 
that the minimum sleep time is limited to one tick of the system clock and that 
it varies with the architecture.

Second, given the above, there seems to be an initialization or end point count 
problem.  The minimum time seems to be two ticks, not one and the sleep time is 
one more tick than is requested.

-----Original Message-----
From: owner-...@openbsd.org <owner-...@openbsd.org> On Behalf Of Philip Guenther
Sent: May 21, 2018 7:29 PM
To: Stephen Graf <s_g...@telus.net>
Cc: arm@openbsd.org; Artturi Alm <artturi....@gmail.com>
Subject: Re: nanosleep issue

On Mon, May 21, 2018 at 11:30 AM, <s_g...@telus.net> wrote:

> Thank you for the patch.  I applied it and am now able to get times 
> less than 20 ms.  However the time is now off by 1 ms instead of 10. A 
> sleep of
> 10 ms goes 11 ms and a 1 ms sleep goes 2ms.  See attached.
>

OpenBSD is not a tickless kernel.  If you need nanosleep precision that's much 
higher than what you're seeing, then OpenBSD is not currently able to meet your 
requirements.

Would it be better to be tickless?  Sure, but no one has sat down and figured 
out how to do that _and_ continue to support the range of hardware we support.  
Is it on peoples' lists? Sure, but so is a lot of other stuff which is higher 
priority.  Some day?


Philip Guenther

Reply via email to