A very informative node on threads (++ to all).

Am I just being too sarcastic to see the value in spawning of a bunch of threads that just do a backtick operation? Don't get me wrong, I see the general value in the question and answers about thread spawning and joining but would this be a proper monks node without someone questioning the given script. Is there something funky about perl on Win32 that I'm missing (like backticks don't fork/exec). Or more general, is there any value in spawing threads that will just fork/exec a cmd.

My first inclination is that no, there is no value in that. You should either junk the thread overhead and just stick with fork/exec (and not use backticks because there's overhead in that with a shell coming into the equation) or find some "thread-safe/thread-aware" way to ping (is Net::Ping thread-safe?).

However, if this is just an exercise in threading and is not going to be used in the real world - then nevermind.

-derby


In reply to Re: Using threads with Ping by derby
in thread Using threads with Ping by JamesNC

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.