Skip to navigation

holoscan::run

Beta
View as Markdown
HOLOSCAN_CORE_EXPORT int holoscan::run(
const ExecutionPlan &plan
)

Attempt to execute one accepted plan synchronously through the session runtime.

This is the blocking wrapper over the exact path used by run_async(). On Linux it is equivalent to run(plan, RunSignalPolicy::kManaged). A compatible early ManagedShutdownSignals domain is adopted when present; otherwise transient admission requires both process-task census reads to observe exactly one live task. Census failure, change, or any additional live task rejects admission before session creation. Adopting an explicit domain consumes its sole binding attempt; after retirement, close it and create a fresh domain before another managed run. Only one process-wide managed binding can be active. An accepted plan whose required runtime bindings are unavailable terminates with failure before invoking user callbacks. Cold run-generation or session-storage exhaustion likewise returns nonzero through the terminal failed-session path rather than escaping as a startup exception.

This call blocks through cooperative callback retirement, cleanup, and worker join. No whole-run or forced-cancellation time bound is provided.

Returns: Zero for natural or explicitly requested successful completion; nonzero for stopped, failed, or rejected managed-signal admission. A compiler-accepted empty Graph is a valid zero-work plan and returns zero. An Operator-requested completion returns zero even though it does not guarantee EOS, source closure, downstream drain, or queued-sample delivery. On Linux, a first managed SIGINT or SIGTERM requests stopped execution and therefore returns nonzero after cleanup.

Throws: CompileError when plan is a default-constructed empty plan handle or compile admission rejected it.

Throws: std::system_error if the platform thread join operation fails.

Parameters

plan
const ExecutionPlan &

Immutable accepted plan to execute.