From: Joe Martin Date: 2010-03-05T07:14:04+09:00 Subject: Re: Limit number of concurrent running threads in pool Roger Pack wrote: >> I created a pool of threads (say, 500 threads) to process. However, due >> to the weight of each thread, I want to limit the number of threads that >> run concurrently. >> >> So how would I go about putting a limit on the number of threads that >> run at any given time? I would like to take, say, 5 threads from the >> pool and run them, and as each one completes, it is removed from the >> pool and is replaced with a new thread from the pool. > > http://github.com/spox/actionpool > > might help. > -r Thank you very much, Roger. I found this link (http://snippets.dzone.com/posts/show/3276) which it looks like you had a part in as well and just got that code working shortly after posting this thread. But looking into ActionPool, it definitely offers expanded functionality so I will probably implement that solution instead. Cheers! -- Posted via http://www.ruby-forum.com/.