17 #ifndef CYBER_SCHEDULER_POLICY_CLASSIC_CONTEXT_H_ 18 #define CYBER_SCHEDULER_POLICY_CLASSIC_CONTEXT_H_ 25 #include <unordered_map> 38 static constexpr uint32_t MAX_PRIO = 20;
40 #define DEFAULT_GROUP_NAME "default_grp" 44 using CR_GROUP = std::unordered_map<std::string, MULTI_PRIO_QUEUE>;
45 using LOCK_QUEUE = std::array<base::AtomicRWLock, MAX_PRIO>;
48 using GRP_WQ_MUTEX = std::unordered_map<std::string, MutexWrapper>;
49 using 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;
88 #endif // CYBER_SCHEDULER_POLICY_CLASSIC_CONTEXT_H_ Definition: processor_context.h:33
std::unordered_map< std::string, int > NOTIFY_GRP
Definition: classic_context.h:50
std::unordered_map< std::string, MULTI_PRIO_QUEUE > CR_GROUP
Definition: classic_context.h:44
static CR_GROUP cr_group_
Definition: classic_context.h:64
static RQ_LOCK_GROUP rq_locks_
Definition: classic_context.h:65
std::array< CROUTINE_QUEUE, MAX_PRIO > MULTI_PRIO_QUEUE
Definition: classic_context.h:43
Definition: mutex_wrapper.h:26
std::shared_ptr< CRoutine > NextRoutine() override
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
std::array< base::AtomicRWLock, MAX_PRIO > LOCK_QUEUE
Definition: classic_context.h:45
static GRP_WQ_CV cv_wq_
Definition: classic_context.h:66
Definition: cv_wrapper.h:26
static bool RemoveCRoutine(const std::shared_ptr< CRoutine > &cr)
std::unordered_map< std::string, CvWrapper > GRP_WQ_CV
Definition: classic_context.h:49
std::unordered_map< std::string, LOCK_QUEUE > RQ_LOCK_GROUP
Definition: classic_context.h:46
static NOTIFY_GRP notify_grp_
Definition: classic_context.h:68
#define CACHELINE_SIZE
Definition: macros.h:31
static GRP_WQ_MUTEX mtx_wq_
Definition: classic_context.h:67
Definition: classic_context.h:52
static void Notify(const std::string &group_name)
std::vector< std::shared_ptr< CRoutine > > CROUTINE_QUEUE
Definition: classic_context.h:42
std::unordered_map< std::string, MutexWrapper > GRP_WQ_MUTEX
Definition: classic_context.h:48