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

Method NotifyOrRunScheduler

oneflow/core/vm/virtual_machine.cpp:287–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287Maybe<void> VirtualMachine::NotifyOrRunScheduler() {
288 if (unlikely(pthread_fork::IsForkedSubProcess() || threads_closed_ || !multi_thread_)) {
289 ScheduleUntilVMEmpty(engine_.Mutable(), SingleThreadScheduleCtx());
290 } else {
291 pending_notifier_.Notify();
292 }
293 return Maybe<void>::Ok();
294}
295
296Maybe<void> VirtualMachine::CloseWorkerThreads() {
297 JUST(ForEachThreadCtx(engine_.Mutable(), [&](vm::ThreadCtx* thread_ctx) -> Maybe<void> {

Callers

nothing calls this directly

Calls 5

IsForkedSubProcessFunction · 0.85
ScheduleUntilVMEmptyFunction · 0.85
NotifyMethod · 0.80
MutableMethod · 0.45

Tested by

no test coverage detected