MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / AddWork

Method AddWork

oneflow/core/thread/thread_pool.cpp:40–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void ThreadPool::AddWork(const std::function<void()>& work) {
41 const size_t cur_chan_idx =
42 work_cnt_.fetch_add(1, std::memory_order_relaxed) % work_chans_.size();
43 work_chans_.at(cur_chan_idx).Send(work);
44}
45
46} // namespace oneflow

Callers 9

FOR_RANGEMethod · 0.80
FOR_RANGEFunction · 0.80
FOR_RANGEMethod · 0.80
FOR_RANGEMethod · 0.80
CompileMethod · 0.80
FOR_RANGEMethod · 0.80
FOR_RANGEFunction · 0.80
FOR_RANGEFunction · 0.80

Calls 3

sizeMethod · 0.45
SendMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected