Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-03-21 19:27:03


--- "Moore, Dave" <dmoore_at_[hidden]> wrote:
>As for the size, given a min and max size, the size of the pool will shrink
>towards the min when threads are idle for longer than the timeout value, and
>will grow towards the max whenever a new job arrives and no idle threads are
>available.

That is the point. You inprint in your implementation following algorithm of idle threads management:
1. Minimum number of threads m1.
2. Maximum number of threads m2.
3. If thread is older t1 -> destroy.
4. If need more thread - create one.

Are you sure that this model wil fit for any possible usage of thread pool. What if I do not want to destroy my threads ever during program lifetime of vice vesa immidiatelly when returned to pool? What if I just want support some ballance between amount of used threads at the moment and amoumt of idle ones? What if I want ballance parameters to change depend of time of the day or load of the server? And so on.

I would prefer provide a solution that allows more flexibility.

Gennadiy.

_____________________________________________________________
A free email account your friends will never forget!
Get YOURNAME_at_[hidden] at http://www.emailaccount.com/

_____________________________________________________________
Run a small business? Then you need professional email like you_at_[hidden] from Everyone.net http://www.everyone.net?tag


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