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
You should use the Queue class. Each thread should put its result in the queue, and the main thread should fetch it from there. Notice that using that approach, results my be in a order different from thread creation order in the queue.