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)
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)
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.
bool empty() const
Checks if the scheduler is empty.
SchedulingPolicy which implements prioritized ordering.
bool push(task_type const &task)
Adds a new task to the scheduler.
Task task_type
Indicates the scheduler's task type.
void pop()
Removes the task which should be executed next.
std::priority_queue< task_type > m_container
Internal task container.
void pop()
Removes the task which should be executed next.
std::deque< task_type > m_container
Internal task container.
void clear()
Removes all tasks from the scheduler.
task_type const & top() const
Gets the task which should be executed next.
size_t size() const
Gets the current number of tasks in the scheduler.
bool push(task_type const &task)
Adds a new task to the scheduler.
size_t size() const
Gets the current number of tasks in the scheduler.
std::deque< task_type > m_container
Internal task container.
void pop()
Removes the task which should be executed next.
Task task_type
Indicates the scheduler's task type.
task_type const & top() const
Gets the task which should be executed next.
void clear()
Removes all tasks from the scheduler.
bool empty() const
Checks if the scheduler is empty.
void clear()
Removes all tasks from the scheduler.
Task task_type
Indicates the scheduler's task type.
SchedulingPolicy which implements FIFO ordering.
size_t size() const
Gets the current number of tasks in the scheduler.
bool push(task_type const &task)
Adds a new task to the scheduler.
task_type const & top() const
Gets the task which should be executed next.
bool empty() const
Checks if the scheduler is empty.
SchedulingPolicy which implements LIFO ordering.