Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

What?   Did I hear my name used in vain, on such a pleasant Sunday morn?

He has a point:   use a thread to enqueue the jobs for the other threads.   This thread is the “nanny,” whose only purpose is to keep the children fed.   (Or in the good ol’ days, it is the Job Entry Subsystem of what was then called MVS now z/OS.)   It runs until it runs out of food, then quits.   If that thread winds up waiting-forever, so what.

The bottom line is that the parent does not have to be directly responsible for job-queueing.   The parent does not have to wait for it, and so, job-queueing will occur properly no matter what the user (interface ...) is or is not doing.   It is no longer “the parent’s concern.”   The parent’s only concern, now, is to run the user-interface until all of its children die (or until “the last man standing” is the scheduler).   Although the responsibilities of one particular child are somewhat greater than that of all the others, the parent has no need to “be concerned.”

It’s very hard, in any language, to have a (especially, to have a parent) thread with two concerns, and also to be both user-facing and peer-facing at the same time.

In reply to Re: How can I force thread switching? by sundialsvc4
in thread How can I force thread switching? by ajl52

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (6)
    As of 2018-06-22 04:18 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (121 votes). Check out past polls.