Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Default scheduler use in Hedgehog graph. More...
#include "default_scheduler.h"
Public Member Functions | |
DefaultScheduler () | |
Default constructor. | |
~DefaultScheduler () override=default | |
Default destructor. | |
std::unique_ptr< Scheduler > | create () const override |
Definition of virtual constructor. | |
void | spawnThreads (std::set< core::abstraction::NodeAbstraction * > const &cores, bool waitForInitialization) override |
Spawn the threads for all graph's nodes. | |
void | joinAll () override |
Wait for all inside nodes to join and join the threads of all inside graphs. | |
![]() | |
Scheduler ()=default | |
Scheduler default constructor. | |
virtual | ~Scheduler ()=default |
Scheduler default destructor. | |
virtual std::unique_ptr< Scheduler > | create () const =0 |
Definition of virtual constructor. | |
virtual void | spawnThreads (std::set< core::abstraction::NodeAbstraction * > const &cores, bool waitForInitialization)=0 |
Spawn the threads of a graph. | |
virtual void | joinAll ()=0 |
Method waiting for all graph's threads termination, called when Graph::waitForTermination() is called. | |
Private Attributes | |
std::unique_ptr< std::vector< std::thread > > const | threads_ = nullptr |
Vector of threads for the graph nodes. | |
std::unique_ptr< std::vector< core::abstraction::GraphNodeAbstraction * > > | innerGraphs_ = nullptr |
Scheduler's graph. | |
Default scheduler use in Hedgehog graph.
By default, each node that needs a thread gets a thread and management of these threads is left to the OS.
Definition at line 38 of file default_scheduler.h.
|
inline |
Default constructor.
Definition at line 48 of file default_scheduler.h.
|
overridedefault |
Default destructor.
|
inlineoverridevirtual |
Definition of virtual constructor.
Implements hh::Scheduler.
Definition at line 57 of file default_scheduler.h.
|
inlineoverridevirtual |
Wait for all inside nodes to join and join the threads of all inside graphs.
Implements hh::Scheduler.
Definition at line 96 of file default_scheduler.h.
|
inlineoverridevirtual |
Spawn the threads for all graph's nodes.
cores | Graph's inside nodes |
waitForInitialization | Wait for internal nodes to be initialized flags |
std::runtime_error | if a thread cannot be created, or if the core is malformed |
If asked, wait for all internals to be initialized before returning
Implements hh::Scheduler.
Definition at line 63 of file default_scheduler.h.
|
private |
Scheduler's graph.
Definition at line 44 of file default_scheduler.h.
|
private |
Vector of threads for the graph nodes.
Definition at line 41 of file default_scheduler.h.