Boost logo

Boost :

From: William E. Kempf (wekempf_at_[hidden])
Date: 2002-11-11 13:52:04


Eric Woodruff said:
> Yeah, it's the same concept. I had failed to distinguish thread_pool
> versus thread_group.
>
> Hopefully, adding the timeout and growing logic does not sacrifice the
> efficiency of the pool when it is full/has plenty to work on.

Shouldn't be a large issue. If the pool is full (i.e. max_threads has
been created and all are busy) the queue can still be added to, so there's
no effect to the performance of add. The check for being full is a simple
integer comparison, so shouldn't effect the performance. The check for
decaying a thread uses conditions and timeouts, so also should not effect
the efficiency. The only thing that can effect efficiency is the actual
act of creating a thread when the pool grows, but careful specification of
min/max/timeout can optimize this. If you have to, you can specify
min/max to be the same, thus fixing the size of the pool and ensuring you
never incur the overhead of growing the pool. However, this will often be
at a sacrifice to resource utilization, so individual needs will have to
dictate how one defines these parameters.

-- 
William E. Kempf

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk