learnedbyerror has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Thread::Pool::Simple || !
by BrowserUk (Patriarch) on Jul 17, 2012 at 18:18 UTC | |
|
Re: Thread::Pool::Simple || !
by bulk88 (Priest) on Jul 18, 2012 at 08:48 UTC | |
by learnedbyerror (Monk) on Jul 18, 2012 at 14:46 UTC | |
by BrowserUk (Patriarch) on Jul 18, 2012 at 15:22 UTC | |
by learnedbyerror (Monk) on Jul 18, 2012 at 19:02 UTC | |
by bulk88 (Priest) on Jul 18, 2012 at 23:10 UTC | |
by BrowserUk (Patriarch) on Jul 18, 2012 at 19:31 UTC | |
| |
by BrowserUk (Patriarch) on Jul 18, 2012 at 19:21 UTC |