MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Schedule

Method Schedule

tensorflow/core/kernels/work_queue_ops.cc:169–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 }
168
169 void Schedule(int64 num_threads, std::function<void()> fn) {
170 std::unique_lock<std::mutex> lock(mu_);
171 if (threads_) {
172 lock.unlock();
173 threads_->Schedule(fn);
174 return;
175 }
176
177 threads_.reset(
178 new thread::ThreadPool(Env::Default(), ThreadOptions(),
179 strings::StrCat("work_queue_threads_", name_),
180 num_threads, false /* low_latency_hint */));
181
182 lock.unlock();
183 threads_->Schedule(fn);
184 }
185
186 private:
187 // TODO(yuanman.ym): Use memory efficient data structure, e.g. HAT-trie,

Callers 15

RunMethod · 0.45
RunMethod · 0.45
ComputeAsyncMethod · 0.45
CreateSparseSlicesMethod · 0.45
ShuffleMatrixMethod · 0.45
do_on_all_threadsFunction · 0.45
ComputeMethod · 0.45
AcquireAsyncMethod · 0.45
ExecuteMethod · 0.45
ComputeMethod · 0.45
RecordYielderMethod · 0.45
MainLoopMethod · 0.45

Calls 5

DefaultFunction · 0.85
ThreadOptionsClass · 0.85
StrCatFunction · 0.50
unlockMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected