lib/bundler/parallel_workers/unix_worker.rb
# Start the threads whose job is basically to wait for incoming messages
# on request queue and write that message to the connected pipe. Also retrieve
# messages from child worker via connected pipe and write the message to response queue
#
# @param size [Integer] Number of threads to be started
Start the threads whose job is basically to wait for incoming messages
on request queue and write that message to the connected pipe. Also retrieve
messages from child worker via connected pipe and write the message to response queue
Start the threads whose job is basically to wait for incoming messages on request queue and write that message to the connected pipe . Also retrieve messages from child worker via connected pipe and write the message to response queue
def prepare_threads(size)
        @threads = size.times.map do |i|
          Thread.start do
            worker = @workers[i]
            loop do
              obj = @request_queue.deq
              break if obj.equal? POISON
              @response_queue.enq worker.work(obj)
            end
          end
        end
      end
def prepare_threads ( size ) @threads = size . times . map do | i | Thread . start do worker = @workers [ i ] loop do obj = @request_queue . deq break if obj . equal? POISON @response_queue . enq worker . work ( obj ) end end end end
Start the threads whose job is basically to wait for incoming messages
on request queue and write that message to the connected pipe.
Start the threads whose job is basically to wait for incoming messages on request queue and write that message to the connected pipe .
size
Number of threads to be started
Number of threads to be started