On 8/9/2011 1:44 PM, Greg Trasuk wrote:
On Tue, 2011-08-09 at 15:36, Patricia Shanahan wrote:
3. Use a dedicated thread that sleeps until it is time to reconsider the
number of tasks, processes the queue of log messages, does any
adjustment, and then goes back to sleep. This is the most reliable in
terms of getting adjustments made when they are needed, but costs the
overhead of an extra thread that is just managing the thread pool.
Any views, alternatives?
If I'm not mistaken, a mostly-time-blocked thread carries very little
resource overhead. So I'd lean towards this approach.
That is one of the reasons why I'm inclined to wait until it is time for
a decision, then dump all the messages from the queue, rather than pop a
message whenever one is available.
I've thought of another advantage of the separate thread. It makes it
very easy to see what resources I'm spending on managing the pool.
Patricia