… | |
… | |
225 | coros as required. |
225 | coros as required. |
226 | |
226 | |
227 | If you are concerned about pooled coroutines growing a lot because a |
227 | If you are concerned about pooled coroutines growing a lot because a |
228 | single C<async_pool> used a lot of stackspace you can e.g. C<async_pool |
228 | single C<async_pool> used a lot of stackspace you can e.g. C<async_pool |
229 | { terminate }> once per second or so to slowly replenish the pool. In |
229 | { terminate }> once per second or so to slowly replenish the pool. In |
230 | addition to that, when the stacks used by a handler grows larger than 16kb |
230 | addition to that, when the stacks used by a handler grows larger than 32kb |
231 | (adjustable via $Coro::POOL_RSS) it will also be destroyed. |
231 | (adjustable via $Coro::POOL_RSS) it will also be destroyed. |
232 | |
232 | |
233 | =cut |
233 | =cut |
234 | |
234 | |
235 | our $POOL_SIZE = 8; |
235 | our $POOL_SIZE = 8; |
236 | our $POOL_RSS = 16 * 1024; |
236 | our $POOL_RSS = 32 * 1024; |
237 | our @async_pool; |
237 | our @async_pool; |
238 | |
238 | |
239 | sub pool_handler { |
239 | sub pool_handler { |
240 | while () { |
240 | while () { |
241 | eval { |
241 | eval { |