67 intmax_t subq = -1)
override;
73 virtual void Wait()
override {}
74 virtual void resize(intmax_t)
override;
76 virtual bool empty()
const override;
103 intmax_t m_thread_bin;
104 mutable intmax_t m_insert_bin;
105 std::atomic_bool* m_hold;
106 std::atomic_uintmax_t* m_ntasks;
109 std::vector<int> m_rand_list;
110 std::vector<int>::iterator m_rand_itr;
117#include "PTL/UserTaskQueue.icc"
124 return (m_ntasks->load(std::memory_order_relaxed) == 0);
132 return m_ntasks->load(std::memory_order_relaxed);
140 return (*m_subqueues)[bin]->size();
148 return (*m_subqueues)[bin]->empty();
156 for(
const auto& itr : *m_subqueues)
168 for(
const auto& itr : *m_subqueues)
virtual void Wait() override
std::default_random_engine random_engine_t
virtual VUserTaskQueue * clone() override
std::vector< TaskSubQueue * > TaskSubQueueContainer
virtual size_type size() const override
virtual void resize(intmax_t) override
virtual task_pointer GetTask(intmax_t subq=-1, intmax_t nitr=-1) override
virtual intmax_t GetThreadBin() const override
virtual intmax_t InsertTask(task_pointer, ThreadData *=nullptr, intmax_t subq=-1) override
virtual void ExecuteOnSpecificThreads(ThreadIdSet tid_set, ThreadPool *tp, function_type f) override
intmax_t GetInsertBin() const
virtual bool bin_empty(size_type bin) const override
virtual void ExecuteOnAllThreads(ThreadPool *tp, function_type f) override
bool true_empty() const override
virtual bool empty() const override
virtual ~UserTaskQueue() override
virtual size_type bin_size(size_type bin) const override
std::uniform_int_distribution< int > int_dist_t
task_pointer GetThreadBinTask()
size_type true_size() const override
VTask is the abstract class stored in thread_pool.
std::set< ThreadId > ThreadIdSet
std::function< void()> function_type