22 #ifndef THREADPOOL_SCHEDULING_POLICIES_HPP_INCLUDED 23 #define THREADPOOL_SCHEDULING_POLICIES_HPP_INCLUDED 31 namespace boost {
namespace threadpool
44 template <
typename Task = task_func>
59 bool push(task_type
const & task)
61 m_container.push_back(task);
69 m_container.pop_front();
75 task_type
const &
top()
const 77 return m_container.front();
86 return m_container.size();
95 return m_container.empty();
117 template <
typename Task = task_func>
131 bool push(task_type
const & task)
133 m_container.push_front(task);
141 m_container.pop_front();
147 task_type
const &
top()
const 149 return m_container.front();
158 return m_container.size();
167 return m_container.empty();
192 template <
typename Task = prio_task_func>
207 bool push(task_type
const & task)
209 m_container.push(task);
223 task_type
const &
top()
const 225 return m_container.top();
234 return m_container.size();
243 return m_container.empty();
250 while(!m_container.empty())
261 #endif // THREADPOOL_SCHEDULING_POLICIES_HPP_INCLUDED The namespace threadpool contains a thread pool and related utility classes.
SchedulingPolicy which implements prioritized ordering.
bool push(task_type const &task)
Task task_type
Indicates the scheduler's task type.
std::priority_queue< task_type > m_container
Internal task container.
std::deque< task_type > m_container
Internal task container.
task_type const & top() const
bool push(task_type const &task)
std::deque< task_type > m_container
Internal task container.
Task task_type
Indicates the scheduler's task type.
task_type const & top() const
Task task_type
Indicates the scheduler's task type.
SchedulingPolicy which implements FIFO ordering.
bool push(task_type const &task)
task_type const & top() const
SchedulingPolicy which implements LIFO ordering.