title: How can I return a value from a thread in Ruby?
body: <p>If I have the following code :</p>
  
  <pre><code>threads = []
  (1..5).each do |i|
    threads &lt;&lt; Thread.new { `process x#{i}.bin` } 
  end
  threads.each do |t|
    t.join
    # i'd like to get the output of the process command now.
  end
  </code></pre>
  
  <p>What do I have to do to get the output of the process command? How could I create a custom thread so that I can accomplish this?</p>