I don't think this would help, because (according to my tests) it's the child processes that hang in a FUTEX_WAIT (as nothing seems to be calling FUTEX_WAKE again any more):

7160 futex(0x808248, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...> 7162 futex(0x808248, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...> 7164 futex(0x808248, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...> ...

(filtered strace output)

Also, the results vary structurally (not only quantitatively) with the number of threads started, whether you run the script under strace, etc., so I suspect it's some race condition issue.  In other words, a varying number of children simply don't terminate, so there are no corresponding SIGCHLD signals.

Unfortunately, I don't know enough about Perl's thread implementation to be of any real help here...

So, until someone more knowledgable in the area has found sufficient motivation and time to tackle those issues, I'd stick with the common recommendation to stay away from mixing threads with fork.


In reply to Re^2: problems with fork from thread by Eliya
in thread problems with fork from thread by cristi1979

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.