Oh Monks,

Please tolerate yet another question from the village idiot :)

I would very much like to achieve the functionality of Thread::Pool::Simple; however, I often see posts about the ills of using modules for thread pools. How should I proceed forward?

Creating a pool of threads is straight forward; however, insuring that they run without error on long running worker threads ( 100 - 200K executions per worker) is a problem in my case. I need to start a new worker up if one of my worker threads abends.

I have placed eval around pretty much everything that I can think of and have a wrapper that I use to restart the worker sub in a thread if the sub exits unexpectedly. The combination of the two has my app running pretty damn realiably. But, it is not quiet reliable enough to put in a batch environment and ignore.

What I like about Threads::Pool::Simple and the ilk is the purported ability to start a new thread if the wrapper et al gets blown away. My worker threads do not depend upon the thread manager (i.e. Boss) to send any data to them or to process any data upon completion. The worker threads do this on their own either through Thread::Queues or based upon date from a MySQL database. So freeze/thaw issues aren't a concern of mine.

My concern is that I really don't want to have to crank crank my own handler and the associated HOH to manage the state, on my own if I can help it.

Can anyone recommend an approach or point me to sample code that addresses Boss/Worker Pool thread management?

Thanks in advance, lbe


In reply to Thread::Pool::Simple || ! by learnedbyerror

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.