def _run_parallel(self, fname, *args) -> List[Result]:
    signaling_queue: Queue = Queue()
    processes = []
    for (idx, (engine_class, opts)) in enumerate(self.engines):
        options = opts
        _p = Process(name=str(idx), target=_run, args=(idx, engine_class, options, signaling_queue, fname, *args))
        processes.append(_p)
        _p.start()
    processes_alive = len(processes)
    results: List[Result] = []
    definitive_result_found: bool = False
    while True:
        if (processes_alive == 0):
            break
        (idx, res) = signaling_queue.get(block=True)
        processes_alive -= 1
        if isinstance(res, BaseException):
            raise res
        else:
            assert isinstance(res, Result)
            if res.is_definitive_result(*args):
                definitive_result_found = True
                break
            else:
                results.append(res)
    for p in processes:
        p.terminate()
    if definitive_result_found:
        return [res]
    return results
def _run_parallel(self, fname, *args) -> List[Result]:
    signaling_queue: Queue = Queue()
    processes = []
    for (idx, (engine_class, opts)) in enumerate(self.engines):
        options = opts
        _p = Process(name=str(idx), target=_run, args=(idx, engine_class, options, signaling_queue, fname, *args))
        processes.append(_p)
        _p.start()
    processes_alive = len(processes)
    results: List[Result] = []
    definitive_result_found: bool = False
    while True:
        if (processes_alive == 0):
            break
        (idx, res) = signaling_queue.get(block=True)
        processes_alive -= 1
        if isinstance(res, BaseException):
            raise res
        else:
            assert isinstance(res, Result)
            if res.is_definitive_result(*args):
                definitive_result_found = True
                break
            else:
                results.append(res)
    for p in processes:
        p.terminate()
    if definitive_result_found:
        return [res]
    return results