'All forked dataflows are reset **once and only once** in spawned processes.
Nothing more can be done when calling this method.'

def reset_state(self):

    if self._setup_done:
        return
    self._setup_done = True
    self.context = zmq.Context()
    self.socket = self.context.socket(zmq.PULL)
    pipedir = os.environ.get('TENSORPACK_PIPEDIR', '.')
    assert os.path.isdir(pipedir), pipedir
    self.pipename = ('ipc://{}/dataflow-pipe-'.format(pipedir.rstrip('/')) + str(uuid.uuid1())[:6])
    self.socket.set_hwm(self._hwm)
    self.socket.bind(self.pipename)
    self.procs = [PrefetchProcessZMQ(self.ds, self.pipename, self._hwm) for _ in range(self.nr_proc)]
    self._start_processes()
    import atexit
    atexit.register((lambda x: x.__del__()), self)
