[asterisk-dev] [Code Review] Add a min_size option to threadpools

Sean Bright reviewboard at asterisk.org
Fri Feb 1 11:48:09 CST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2307/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

Threadpools currently support an initial_size option which dictates how many threads are created when the pool is created.  If you also have an idle_timeout set, idle threads that don't do any work for the specified period of time are killed off.  If both of these options are used, the threadpool will create initial_size threads, and then idle_timeout seconds later kill off all of those threads, assuming no activity in the meantime.

This patch adds a min_size option which instructs the threadpool to keep around the specified number of threads, even if they are idle.  This allows the threadpool to grow to handle increased task demand, but always keep the specified number of threads around to handle future request.


Diffs
-----

  /trunk/include/asterisk/threadpool.h 380770 
  /trunk/main/threadpool.c 380770 

Diff: https://reviewboard.asterisk.org/r/2307/diff


Testing
-------

Compiles.


Thanks,

Sean

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130201/90ed1ec5/attachment.htm>


More information about the asterisk-dev mailing list