set max_spin=0 to prevent Queue fetch task in busy wait manner. this won't affect throughput when python interpreter is sending enough task, but will significantly save CPU time when waiting for task, e.g. wait for data input
| 76 | // but will significantly save CPU time when waiting for task, e.g. wait for |
| 77 | // data input |
| 78 | Queue() : mgb::AsyncQueueSC<std::function<void(void)>, Queue>(0) {} |
| 79 | |
| 80 | void process_one_task(Task& f) { |
| 81 | if (!Py_IsInitialized()) |
no outgoing calls