17#ifndef CYBER_SCHEDULER_POLICY_CLASSIC_CONTEXT_H_
18#define CYBER_SCHEDULER_POLICY_CLASSIC_CONTEXT_H_
25#include <unordered_map>
38static constexpr uint32_t MAX_PRIO = 20;
40#define DEFAULT_GROUP_NAME "default_grp"
44using CR_GROUP = std::unordered_map<std::string, MULTI_PRIO_QUEUE>;
45using LOCK_QUEUE = std::array<base::AtomicRWLock, MAX_PRIO>;
49using GRP_WQ_CV = std::unordered_map<std::string, CvWrapper>;
61 static void Notify(
const std::string &group_name);
71 void InitGroup(
const std::string &group_name);
73 std::chrono::steady_clock::time_point wake_time_;
74 bool need_sleep_ =
false;
81 std::string current_grp;
static void Notify(const std::string &group_name)
static RQ_LOCK_GROUP rq_locks_
static CR_GROUP cr_group_
static GRP_WQ_MUTEX mtx_wq_
static bool RemoveCRoutine(const std::shared_ptr< CRoutine > &cr)
std::shared_ptr< CRoutine > NextRoutine() override
static NOTIFY_GRP notify_grp_
std::unordered_map< std::string, MutexWrapper > GRP_WQ_MUTEX
std::array< base::AtomicRWLock, MAX_PRIO > LOCK_QUEUE
std::unordered_map< std::string, CvWrapper > GRP_WQ_CV
std::array< CROUTINE_QUEUE, MAX_PRIO > MULTI_PRIO_QUEUE
std::unordered_map< std::string, LOCK_QUEUE > RQ_LOCK_GROUP
std::vector< std::shared_ptr< CRoutine > > CROUTINE_QUEUE
std::unordered_map< std::string, MULTI_PRIO_QUEUE > CR_GROUP
std::unordered_map< std::string, int > NOTIFY_GRP