Hey,<br><br>just reviving this thread...<br><br><div class="gmail_quote">2011/10/4 Charles Lepple <span dir="ltr"><<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="HOEnZb"><div class="h5">On Mon, Oct 3, 2011 at 1:42 PM, Arnaud Quette <<a href="mailto:aquette.dev@gmail.com">aquette.dev@gmail.com</a>> wrote:<br>
> Hi Regid,<br>
><br>
> 2011/10/3 Stuart D Gathman <<a href="mailto:stuart@bmsi.com">stuart@bmsi.com</a>>:<br>
>> On 10/03/2011 01:02 PM, Regid Ichira wrote:<br>
>>> -             usleep(250000);<br>
>>> +             struct timespec delay = {0, 250e6}; nanosleep(&delay, NULL);<br>
>>><br>
>> Would it be better to define a local version of usleep in terms of<br>
>> nanosleep?  I suspect the library version already does that, but if the<br>
>> library version is going away, a local version is much more concise and<br>
>> readable than calling nanosleep directly.  If there are concerns about<br>
>> linking, the local version could be, e.g, u_sleep, since all the calls<br>
>> are getting touched anyway.<br>
><br>
> sorry, but Stuart is right.<br>
> I should have replied to your other (well, this one) report on this.<br>
> Using AC_REPLACE_FUNCS(... usleep ...) in <a href="http://configure.in" target="_blank">configure.in</a> and providing a<br>
> common/usleep.c->usleep() replacement implementation, in case the<br>
> system doesn't provide it, is a better way to go. At least for now.<br>
> That way, we avoid regression, while supporting systems that do not<br>
> provide usleep.<br>
<br>
</div></div>Out of curiosity, what systems support nanosleep but don't support usleep?<br>
<br>
What would be more worthwhile (IMHO) is to modify the code to make use<br>
of the remaining time returned by nanosleep. Otherwise, I am not sure<br>
I see the benefit of this change.<br></blockquote><div> <br>good idea!<br>would you (Regid and Charles) please take over this task?<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Related is the question of what should be done with the Windows<br>
branch, which defines usleep() in terms of Sleep(). If nothing else,<br>
we should defer this until the Windows branch is ready to merge.<span class="HOEnZb"></span><br></blockquote></div><br>@Fred: can you please check what is available on Windows (ie nanosleep or equivalent), and tell us back?<br clear="all">
<br>cheers,<br>Arnaud<br><br>