MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / Queue

Method Queue

imperative/python/src/helper.h:78–78  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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())

Callers 5

__init__Method · 0.80
__call__Method · 0.80
__init__Method · 0.80
test_group_barrierFunction · 0.80
test_synchronizedFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_group_barrierFunction · 0.64
test_synchronizedFunction · 0.64