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

Method sync

src/core/impl/utils/thread_pool.cpp:117–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void ThreadPool::sync() {
118 bool no_finished = false;
119 do {
120 no_finished = false;
121 for (uint32_t i = 0; i < m_nr_threads - 1; ++i) {
122 if (m_workers[i]->work_flag) {
123 no_finished = true;
124 break;
125 }
126 }
127 if (no_finished) {
128 std::this_thread::yield();
129 }
130 } while (no_finished);
131}
132void ThreadPool::active() {
133 if (!m_active) {
134 std::unique_lock<std::mutex> lock(m_mutex);

Callers 15

test_serializer_memshareFunction · 0.45
TESTFunction · 0.45
load_tensor_sharedMethod · 0.45
scn_do_executeMethod · 0.45
load_tensor_sharedMethod · 0.45
applyMethod · 0.45
TESTFunction · 0.45
run_level2Function · 0.45
run<sync_from_func>Function · 0.45
run<cb_non_contig>Function · 0.45

Calls

no outgoing calls

Tested by 15

test_serializer_memshareFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
run_level2Function · 0.36
run<sync_from_func>Function · 0.36
run<cb_non_contig>Function · 0.36
eval_convFunction · 0.36
run_noncontig_testFunction · 0.36
TESTFunction · 0.36
run_negative_index_testFunction · 0.36
TESTFunction · 0.36