17#ifndef CYBER_SCHEDULER_SCHEDULER_H_
18#define CYBER_SCHEDULER_SCHEDULER_H_
28#include <unordered_map>
31#include "cyber/proto/choreography_conf.pb.h"
56class ProcessorContext;
64 bool CreateTask(std::function<
void()>&& func,
const std::string& name,
65 std::shared_ptr<DataVisitorBase> visitor =
nullptr);
83 const std::unordered_map<std::string, InnerThread>& confs) {
94 std::unordered_map<uint64_t, std::shared_ptr<CRoutine>>
id_cr_;
95 std::vector<std::shared_ptr<ProcessorContext>>
pctxs_;
A implementation of lock-free fixed size hash map
std::string process_level_cpuset_
static Scheduler * Instance()
void ProcessLevelResourceControl()
std::vector< std::shared_ptr< Processor > > processors_
AtomicHashMap< uint64_t, MutexWrapper * > id_map_mutex_
bool NotifyTask(uint64_t crid)
virtual bool DispatchTask(const std::shared_ptr< CRoutine > &)=0
void SetInnerThreadConfs(const std::unordered_map< std::string, InnerThread > &confs)
std::unordered_map< uint64_t, std::shared_ptr< CRoutine > > id_cr_
std::unordered_map< std::string, InnerThread > inner_thr_confs_
std::vector< std::shared_ptr< ProcessorContext > > pctxs_
void SetInnerThreadAttr(const std::string &name, std::thread *thr)
virtual bool NotifyProcessor(uint64_t crid)=0
virtual bool RemoveTask(const std::string &name)=0
bool CreateTask(const RoutineFactory &factory, const std::string &name)
std::atomic< bool > stop_
virtual bool RemoveCRoutine(uint64_t crid)=0