From: Roger Pack Date: 2008-01-01T08:29:50+09:00 Subject: Re: deadlock in ThreadPool using backtick Turns out that the largest problem with the OP was that they were using 1.8.6 patch level 0, which had some buggy buggy thread stuff, so it was declaring 'deadlock' in error. You'll notice some of the threads 'stuck' on lines that should go forward always. I would point out, however, that there still seem to be some concurrency problems in the 1.8.6 MRI. > in general you may be correct - but i think the OP's code has a race > condition. if you look at the stacktrace it's not reading stdout > (backticks) that's got everyone's undies in a wedgie - it's the > shutdown method. so basically the original code starts out by firing I always questioned the shutdown method. I think overall it might still work using the current shutdown method 'if the spawned threads happen to all get to cv.wait before the shutdown thread does' as it probably puts them in an array and sends 'signal' to the first ones that waited for the signal, which would be the 'real' threads not the shutdown thread. Just my $0.02. -- Posted via http://www.ruby-forum.com/.