title: Ruby parallel process in map
body: <p>Help me plz </p>
  
  <p>How i can implement method pmap for Array like map but in two process</p>
  
  <p>I have code</p>
  
  <pre><code>class Array
  
    def pmap
      out = []
      each do |e|
        out &lt;&lt; yield(e)
      end
      out
    end
  
  end
  
  require 'benchmark'
  
  seconds = Benchmark.realtime do
    [1, 2, 3].pmap do |x|
      sleep x
      puts x**x
    end
  end
  
  puts "work #{seconds} seconds"
  </code></pre>
  
  <p>In result i must get 3 second for benchmark</p>