72 void resize(intmax_t)
override;
74 bool empty()
const override;
101 intmax_t m_thread_bin;
102 mutable intmax_t m_insert_bin;
103 std::atomic_bool* m_hold =
nullptr;
104 std::atomic_uintmax_t* m_ntasks =
nullptr;
105 Mutex* m_mutex =
nullptr;
107 std::vector<int> m_rand_list = {};
108 std::vector<int>::iterator m_rand_itr = {};
116 return (m_ntasks->load(std::memory_order_relaxed) == 0);
124 return m_ntasks->load(std::memory_order_relaxed);
132 return (*m_subqueues)[bin]->size();
140 return (*m_subqueues)[bin]->empty();
148 for(
const auto& itr : *m_subqueues)
160 for(
const auto& itr : *m_subqueues)
#define PTL_NO_SANITIZE_THREAD
intmax_t InsertTask(task_pointer &&, ThreadData *=nullptr, intmax_t subq=-1) override PTL_NO_SANITIZE_THREAD
intmax_t GetInsertBin() const
UserTaskQueue(intmax_t nworkers=-1, UserTaskQueue *=nullptr)
size_type true_size() const override
void ExecuteOnAllThreads(ThreadPool *tp, function_type f) override
void resize(intmax_t) override
VUserTaskQueue * clone() override
task_pointer GetTask(intmax_t subq=-1, intmax_t nitr=-1) override
void ExecuteOnSpecificThreads(ThreadIdSet tid_set, ThreadPool *tp, function_type f) override
std::vector< TaskSubQueue * > TaskSubQueueContainer
bool bin_empty(size_type bin) const override
std::default_random_engine random_engine_t
intmax_t GetThreadBin() const override
size_type bin_size(size_type bin) const override
bool true_empty() const override
std::shared_ptr< VTask > task_pointer
task_pointer GetThreadBinTask()
bool empty() const override
~UserTaskQueue() override
std::uniform_int_distribution< int > int_dist_t
size_type size() const override
VTask is the abstract class stored in thread_pool.
std::set< ThreadId > ThreadIdSet
std::function< void()> function_type
VUserTaskQueue(intmax_t nworkers=-1)
Backports of C++ language features for use with C++11 compilers.