[ntp:hackers] Replacing the sigsuspend()/sigpause() by select() with timeout

Martin Burnicki martin.burnicki at meinberg.de
Tue Apr 8 07:59:57 UTC 2008


Danny,

Danny Mayer wrote:
> Martin Burnicki wrote:
>> I wonder why sigsuspend()/sigpause() is being used here instead of a
>> simple sleep().
>>
>> Martin
> 
> I think that Frank implemented that. Have you asked him about this? I
> think that using sigsuspend()/sigpause() allows you to wake it up while
> sleep() will always sleep until the timeout or did I misunderstand?

Yes, I've asked him. On the phone we have discussed several possible
ways to wake up a forked child process from the parent process, and
Frank has proposed the pipe/select method because in his opinion it's
the most safe and portable way to do this. See my comment #7 in bug #987:
https://support.ntp.org/bugs/show_bug.cgi?id=987#c7

Please note I've implemented this differently for Windows since we're
using a thread under Windows, not a forked process.


Martin
-- 
Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont
Germany


More information about the hackers mailing list