in reply to RFC: Using 'threads' common aspects
It’s pretty much “a given” that, when you want to have a pool of worker-threads doing anything-at-all, there should be a configurable number of identical threads, each one reading from a single queue of requests and sending results back to a single queue of completed work for downstream post-processing.
What this allows you to set, is what IBM called the “multiprogramming level” (MPL), which is simply “the maximum number of requests that the system will attempt to service simultaneously.” If requests pile up in the queue, they will eventually be served by “some worker... any one will do.” If the queue runs dry, “one or more workers” will simply be asleep, waiting for the phone to ring.
If you have several distinctly-different classes of requests, consider having a separate queue for each class. Have the workers wait for a message to arrive in any of the queues that they are interested in, and implement some kind of queue-preference mechanism. But, keep it just as simple as you can. Don’t add gratuitous complexity to your design ...
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: Using 'threads' common aspects
by BrowserUk (Patriarch) on Jan 13, 2011 at 04:21 UTC | |
by locked_user sundialsvc4 (Abbot) on Jan 13, 2011 at 13:20 UTC | |
by BrowserUk (Patriarch) on Jan 13, 2011 at 19:44 UTC |