Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

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

The notion of “a request equals a thread” is what I refer to as the “flaming-arrow strategy.”   (Take an arrow, light it off, fire it into the air and forget it.)   Each thread is then supposed to fend for itself, lock what it needs to, issue its requests for data (and wait for the response).   But soon there are problems, often creeping into the designer’s field of vision much too late.   Those problems are workflow dependencies.   Certain things need to be done in a certain order.   Bottlenecks develop as the various fully independent units of dispatchable work try to get things done.   Where certain things must be done in a specific order, it suddenly becomes necessary to devise mutual-exclusion or counting-semaphore kludges.   An “easy and intuitive” initial design does not scale up.

Borrowing an idea from a fast-food restaurant, it is much better to devise the workload as perhaps independent objects, but to manage those using a tote-board of sorts.   The worker-bees work on those units of work according to some heuristic, but they do not “wait for” anything .. ever.   All I/O operations performed are asynchronous, and they are performed against requests that are sitting in some particular stage in the workflow.   The number of requests that are known to the system, which is variable and perhaps extremely large, is completely distinct from the number of workers that are pursuing them.   The entire life cycle of a request, and much of the outer request-handling heuristics, is most easily described using a finite-state machine (FSM) algorithm.

There are plenty of workflow management scaffolds in Perl and otherwise.   With them, I have been able to turn many a recalcitrant and unstable application around, and to retrofit those systems to efficiently work in clustered environments.

In reply to Re: how did blocking IO become such a problem? by sundialsvc4
in thread how did blocking IO become such a problem? by zentara

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 chilling in the Monastery: (5)
    As of 2017-11-22 02:03 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (314 votes). Check out past polls.