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

Method add_worker

src/core/impl/utils/async_worker.cpp:23–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void AsyncWorkerSet::add_worker(const std::string& name, const Task& task) {
24 check_exception();
25
26 m_worker_init_finished.store(false);
27 m_worker_threads.emplace_back(
28 &AsyncWorkerSet::worker_impl_wrapper, this, &name, &task);
29 while (!m_worker_init_finished.load())
30 std::this_thread::yield();
31}
32
33void AsyncWorkerSet::start() {
34 check_exception();

Callers 2

TESTFunction · 0.45
start_execMethod · 0.45

Calls 3

emplace_backMethod · 0.80
storeMethod · 0.45
loadMethod · 0.45

Tested by 1

TESTFunction · 0.36