Class Scheduler
Defined in File scheduler.hh
Class Documentation
-
class Scheduler
Public Functions
-
explicit Scheduler(Environment *env)
-
~Scheduler()
-
void schedule_sync(BaseAction *action, const Tag &tag)
-
auto schedule_async(BaseAction *action, const Duration &delay) -> Tag
-
inline auto lock() noexcept -> auto
-
inline auto logical_time() const noexcept -> const auto&
-
void start()
-
void stop()
Public Members
- friend Worker
Private Functions
-
void fill_action_list_pool()
-
void schedule() noexcept
-
auto schedule_ready_reactions() -> bool
-
void next()
-
void terminate_all_workers()
Private Members
-
const bool using_workers_
-
LogicalTime logical_time_ = {}
-
Environment *environment_
-
std::mutex scheduling_mutex_
-
std::condition_variable cv_schedule_
-
std::shared_mutex mutex_event_queue_
-
std::map<Tag, ActionListPtr> event_queue_
-
std::vector<ActionListPtr> action_list_pool_
-
unsigned int reaction_queue_pos_ = {std::numeric_limits<unsigned>::max()}
-
ReadyQueue ready_queue_
-
std::atomic<std::ptrdiff_t> reactions_to_process_ = {0}
-
std::atomic<bool> stop_ = {false}
-
bool continue_execution_ = {true}
Private Static Attributes
-
static constexpr std::size_t action_list_pool_increment_ = {10}
-
explicit Scheduler(Environment *env)