Class EventBasedScheduler
Defined in File event_based_scheduler.hpp
Base Type
public holoscan::gxf::GXFScheduler(Class GXFScheduler)
-
class EventBasedScheduler : public holoscan::gxf::GXFScheduler
Event-based scheduler.
This is a multi-thread scheduler that uses an event-based design. Unlike the
MultiThreadScheduler, it does not utilize a dedicated polling thread that is constantly polling operators to check which are ready to execute. Instead, certain events in the underlying framework will indicate that the scheduling status of an operator should be checked.==Parameters==
worker_thread_number (int64_t): The number of (CPU) worker threads to use for executing operators. Defaults to 1. This creates a default thread pool. Operators not explicitly assigned to a user-defined thread pool (via make_thread_pool) will use this default pool.
pin_cores (list of int, optional): CPU core IDs to pin the default thread pool’s worker threads to (empty means no core pinning). Note: This only affects the default pool; to control CPU affinity for user-defined thread pools, use the pin_cores parameter in ThreadPool::add().
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.
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.
enable_queue_stealing (bool): If true, default worker threads attempt to steal ready jobs from other default worker queues before blocking on their own queue. Defaults to false.
steal_scan_limit (int64_t): Maximum number of victim queues scanned per steal attempt (0 means scan all queues). Defaults to 0.
enable_worker_postcheck_fastpath (bool): If true, workers perform a fresh checkEntity() after executeEntity() and directly update READY/WAIT_TIME conditions without routing that entity through the dispatcher. Defaults to false.
postcheck_fallback_notify_interval (int64_t): When worker postcheck returns a non-ready state, send a periodic dispatcher wake-up every N fallbacks per worker. Set to 0 to only notify when no workers are running. Defaults to 256.
postcheck_fallback_notify_min_workers (int64_t): Periodic fallback notify is enabled only when worker_thread_number is at least this value. Defaults to 8.
postcheck_fallback_notify_min_period_ns (int64_t): Minimum global time spacing (in nanoseconds) between periodic fallback dispatcher wake-ups. Defaults to 100000.
internal_event_shard_count (int64_t): Number of internal notification shards used by notifyDispatcher (0 = auto = worker_thread_number). Defaults to 0.
dispatcher_internal_pop_batch_size (int64_t): Maximum number of internal notifications drained from one shard per dispatcher pop step. Defaults to 32.
wait_state_shard_count (int64_t): Number of shards used for WAIT_EVENT and WAIT tracking lists. Defaults to 1.
log_perf_stats (bool): If true, logs scheduler instrumentation counters during deinitialize(). Defaults to false.
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 EventBasedScheduler(ArgT &&arg, ArgsT&&... args)
-
EventBasedScheduler() = 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.
-
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() const
-
inline bool stop_on_deadlock() const
-
inline int64_t stop_on_deadlock_timeout() const
-
inline int64_t network_connection_timeout() const
-
inline int64_t max_duration_ms() const
-
inline std::vector<uint32_t> pin_cores() const
-
inline bool enable_queue_stealing()
-
inline int64_t steal_scan_limit()
-
inline bool enable_worker_postcheck_fastpath()
-
inline int64_t postcheck_fallback_notify_interval()
-
inline int64_t postcheck_fallback_notify_min_workers()
-
inline int64_t postcheck_fallback_notify_min_period_ns()
-
inline int64_t internal_event_shard_count()
-
inline int64_t dispatcher_internal_pop_batch_size()
-
inline int64_t wait_state_shard_count()
-
inline bool log_perf_stats()
-
nvidia::gxf::EventBasedScheduler *get() const