If I have the following code :
threads = [] (1..5).each do |i| threads << Thread.new { `process x#{i}.bin` } end threads.each do |t| t.join # i\'d l
Just use Thread#value:
Thread#value
threads = (1..5).collect do |i| Thread.new { `echo x#{i}.bin` } end threads.each do |t| puts t.value end