in reply to Re: Thread::Pool shutdown dies after abort
in thread Thread::Pool shutdown dies after abort
I really like this approach, because it clearly delineates “the units of work that are to be processed” from “the pool of worker-bees that is responsible for processing them.”
There should be enough threads/processes available to allow them to process the incoming requests expediently without unreasonable backlogs ... but they should process many requests during their lifetime, pulling them from a nice, thread-safe queue. BrowserUK's solution clearly demonstrates just how easy that is.
A fast-food restaurant uses exactly the same system to churn out hundreds of grease-burgers to five simultaneous lines in the lobby, as well as one or sometimes two drive-thru windows, using just a handful of grossly-underpaid employees. And no workers are murdered by their manager during the entire shift.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Thread::Pool shutdown dies after abort
by Anonymous Monk on Jul 04, 2011 at 14:48 UTC | |
by BrowserUk (Patriarch) on Jul 04, 2011 at 15:40 UTC |