docstr: Initializes a ProcessPool.
  
  This pool is different from standard Python pool implementations by the fact that the workers are spawned
  without using fork. Some issues with using jvm based HDFS driver were observed when the process was forked
  (could not access HDFS from the forked worker if the driver was already used in the parent process).
  
  :param workers_count: Number of processes to be spawned
  :param serializer: An object that would be used for data payload serialization when sending data from a worker
    process to the main process. ``PickleSerializer`` is used by default. May use
    :class:`petastorm.reader_impl.ArrowTableSerializer` (should be used together with
    :class:`petastorm.reader.ArrowReader`)
  :param zmq_copy_buffers: When set to False, we will use a zero-memory-copy feature of recv_multipart.
    A downside of using this zero memory copy feature is that it does not play nice with Python GC and cases
    were observed when it resulted in wild memory footprint swings. Having the buffers copied is typically a
    safer alternative.
docstr_tok: ["Initializes","a","ProcessPool",".","This","pool","is","different","from","standard","Python","pool","implementations","by","the","fact","that","the","workers","are","spawned","without","using","fork",".","Some","issues","with","using","jvm","based","HDFS","driver","were","observed","when","the","process","was","forked","(","could","not","access","HDFS","from","the","forked","worker","if","the","driver","was","already","used","in","the","parent","process",")",".",":","param","workers_count",":","Number","of","processes","to","be","spawned",":","param","serializer",":","An","object","that","would","be","used","for","data","payload","serialization","when","sending","data","from","a","worker","process","to","the","main","process",".","``","PickleSerializer","``","is","used","by","default",".","May","use",":","class",":","`","petastorm.reader_impl.ArrowTableSerializer","`","(","should","be","used","together","with",":","class",":","`","petastorm.reader.ArrowReader","`",")",":","param","zmq_copy_buffers",":","When","set","to","False",",","we","will","use","a","zero-memory-copy","feature","of","recv_multipart",".","A","downside","of","using","this","zero","memory","copy","feature","is","that","it","does","not","play","nice","with","Python","GC","and","cases","were","observed","when","it","resulted","in","wild","memory","footprint","swings",".","Having","the","buffers","copied","is","typically","a","safer","alternative","."]
code: def __init__(
      self, workers_count, serializer=None, zmq_copy_buffers=True
  ):
      """Initializes a ProcessPool.
  
      This pool is different from standard Python pool implementations by the fact that the workers are spawned
      without using fork. Some issues with using jvm based HDFS driver were observed when the process was forked
      (could not access HDFS from the forked worker if the driver was already used in the parent process).
  
      :param workers_count: Number of processes to be spawned
      :param serializer: An object that would be used for data payload serialization when sending data from a worker
        process to the main process. ``PickleSerializer`` is used by default. May use
        :class:`petastorm.reader_impl.ArrowTableSerializer` (should be used together with
        :class:`petastorm.reader.ArrowReader`)
      :param zmq_copy_buffers: When set to False, we will use a zero-memory-copy feature of recv_multipart.
        A downside of using this zero memory copy feature is that it does not play nice with Python GC and cases
        were observed when it resulted in wild memory footprint swings. Having the buffers copied is typically a
        safer alternative.
      """
      self._workers = []
      self._ventilator_send = None
      self._control_sender = None
      self.workers_count = workers_count
      self._results_receiver_poller = None
      self._results_receiver = None
  
      self._ventilated_items = 0
      self._ventilated_items_processed = 0
      self._ventilator = None
      self._serializer = serializer or PickleSerializer()
      self._zmq_copy_buffers = zmq_copy_buffers
  
imports: import logging
  import pickle
  import sys
  import os
  from time import sleep, time
  from traceback import format_exc
  from threading import Thread
  from psutil import pid_exists
  import zmq
  from zmq import ZMQBaseError
  from petastorm.reader_impl.pickle_serializer import PickleSerializer
  from petastorm.workers_pool import EmptyResultError, VentilatedItemProcessedMessage
  from petastorm.workers_pool.exec_in_new_process import exec_in_new_process
label_desc: Use image node_id 1 to create a new ProcessPool object from inherited base classes: object with example: obj = ProcessPool(workers_count, serializer, zmq_copy_buffers)