Dbus calls interlock issue

Thiago Macieira thiago at kde.org
Fri Feb 13 13:35:36 PST 2009

Scott James Remnant wrote:
>On Fri, 2009-02-13 at 15:50 +0000, Simon McVittie wrote:
>> One of the few safe things to do is write the pid to a pipe (as in
>> pipe(2)) and return; whenever a pid can be read from the other end of
>> the pipe in your main loop, do your cleanup and D-Bus interactions
>> there.
>Though note that if you spawn a large number of children, it is possible
>for this pipe to be filled such that the signal handled blocks on
>It's generally better to use pselect() or ppoll() and otherwise mask
>SIGCHLD out from your process.

pselect wasn't available on Linux until very recently.

You should make your pipe non-blocking. If it's full, the event loop is 
going to wake up anyways very soon now.

  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20090213/6caf3f47/attachment.pgp 

More information about the dbus mailing list