Subsecond sleep

Jed Brown jed at
Sun Oct 18 16:50:37 CDT 2009

Barry Smith wrote:
> Likely, it had sleep() in there and a global search and replace wrongly
> turned it into a PetscSleep().

My docs for sleep(3) have:

       Zero if the requested time has elapsed, or the number of seconds left to sleep, if the call was interrupted by a signal handler.

Presumably the AIX issue was that sleep() was returning without being
interrupted.  What are the desired semantics for PetscSleep(), I expect
it should return early if interrupted, like POSIX sleep()?  If sleep()
returns early even when not interrupted then I don't see a way for
PetscSleep() to return early if it is interrupted but to go for the full
time otherwise.

> The correct fix is to test properly under AIX, but since no one has AIX
> and it sucks it cannot be tested.

Excellent quote.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the petsc-dev mailing list