fork download
  1. threads = []
  2. x = 1
  3. (1..5).each do |i|
  4. x += 1
  5. threads << Thread.new {sleep 1; Thread.current[:output] = "#{x}" }
  6. end
  7. threads.each do |t|
  8. t.join
  9. puts t[:output]
  10. end
  11.  
Success #stdin #stdout 0.01s 6000KB
stdin
Standard input is empty
stdout
6
6
6
6
6