INNER CODE UNIT · Python

cpu

openHiTLS/openHiTLS · testcode/benchmark/async_perf/run_async_perf.py:101

                            cpu = cpus[index % len(cpus)]
                            pin = lambda cpu=cpu: os.sched_setaffinity(0, {cpu})
                        processes.append(subprocess.Popen([str(args.client.resolve()), str(args.port), protocol],
                                                          stdout=subprocess.DEVNULL, stderr=client_log,
                                                          preexec_fn=pin))
                deadline = time.monotonic() + 60
                while True:
                    codes = [process.poll() for process in processes]
                    if any(code not in (None, 0) for code in codes):
                        raise RuntimeError("server or client failed")
                    if all(code is not None for code in codes):
                        break
                    if time.monotonic() >= deadline:
                        raise TimeoutError("batch timed out")
                    time.sleep(0.01)
            except (OSError, RuntimeError, TimeoutError, subprocess.SubprocessError) as exc:
                error = str(exc)
            finally:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…