Class MultiThreadScheduler
Defined in File multithread_scheduler.hpp
Base Type
public holoscan::gxf::GXFScheduler
(Class GXFScheduler)
-
class MultiThreadScheduler : public holoscan::gxf::GXFScheduler
Multi-Thread scheduler.
This is a multi-thread scheduler that uses an event-based design. In addition to the specified
worker_thread_number
of threads for executing operators, it utilizes an additional polling thread that is used to check the execution readiness status of operators at period specified bycheck_recession_period_ms
.==Parameters==
worker_thread_number (int64_t): The number of (CPU) worker threads to use for executing operators. Defaults to 1.
stop_on_deadlock (bool): If True, the application will terminate if a deadlock state is reached. Defaults to true.
stop_on_deadlock_timeout (int64_t): The amount of time (in ms) before an application is considered to be in deadlock. Defaults to 0.
check_recession_period_ms (int64_t): How often the polling thread checks for whether an operator is ready to execute. The value is in ms (default: 5).
max_duration_ms_ (int64_t, optional): Terminate the application after the specified duration even if deadlock does not occur. If unspecified, the application can run indefinitely.
Public Functions
-
template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Scheduler, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>
inline explicit MultiThreadScheduler(ArgT &&arg, ArgsT&&... args)
-
MultiThreadScheduler() = default
-
inline virtual const char *gxf_typename() const override
Get the type name of the GXF scheduler.
The returned string is the type name of the GXF scheduler and is used to create the GXF scheduler.
Example: “nvidia::holoscan::GreedyScheduler”
- Returns
The type name of the GXF scheduler.
-
inline virtual std::shared_ptr<Clock> clock() override
Get the Clock used by the scheduler.
- Returns
The Clock used by the scheduler.
-
virtual void setup(ComponentSpec &spec) override
Define the scheduler specification.
- Parameters
spec – The reference to the component specification.
-
virtual void initialize() override
Initialize the scheduler.
This function is called after the scheduler is created by holoscan::Fragment::make_scheduler().
-
inline int64_t worker_thread_number()
-
inline bool stop_on_deadlock()
-
inline int64_t check_recession_period_ms()
-
inline int64_t stop_on_deadlock_timeout()
-
inline int64_t max_duration_ms()
-
nvidia::gxf::MultiThreadScheduler *get() const