ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro.pm
(Generate patch)

Comparing Coro/Coro.pm (file contents):
Revision 1.132 by root, Thu Sep 20 22:53:23 2007 UTC vs.
Revision 1.133 by root, Fri Sep 21 01:23:58 2007 UTC

224The pool size is limited to 8 idle coroutines (this can be adjusted by 224The pool size is limited to 8 idle coroutines (this can be adjusted by
225changing $Coro::POOL_SIZE), and there can be as many non-idle coros as 225changing $Coro::POOL_SIZE), and there can be as many non-idle coros as
226required. 226required.
227 227
228If you are concerned about pooled coroutines growing a lot because a 228If you are concerned about pooled coroutines growing a lot because a
229single C<async_pool> used a lot of stackspace you can e.g. C<async_pool { 229single C<async_pool> used a lot of stackspace you can e.g. C<async_pool
230terminate }> once per second or so to slowly replenish the pool. 230{ terminate }> once per second or so to slowly replenish the pool. In
231addition to that, when the stacks used by a handler grows larger than 16kb
232(adjustable with $Coro::MAX_POOL_RSS) it will also exit.
231 233
232=cut 234=cut
233 235
234our $POOL_SIZE = 8; 236our $POOL_SIZE = 8;
235our $MAX_POOL_RSS = 64 * 1024; 237our $MAX_POOL_RSS = 16 * 1024;
236our @pool; 238our @pool;
237 239
238sub pool_handler { 240sub pool_handler {
239 while () { 241 while () {
240 $current->{desc} = "[async_pool]"; 242 $current->{desc} = "[async_pool]";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines