Hello,
It appears that when I specify max_threads and keep adding new tasks using ActionPool#process, ActionPool keeps spawini ng new tasks. My code can be summarised as this:
pool = ActionPool::Pool.new(:min_threads => 1, :max_threads => 5)
Dir.entries(targetdir).each {|fe|
pool.process do
process(fe)
end
end
After about processing 160 tasks, I get an error "can't allocate thread" suggesting that ruby has ran out of threads. This is not a problem in a single-thread version of the program.