Async: Add a basic thread_pool executor.
that could have this interface
class thread_pool
{
public:
BOOST_THREAD_NO_COPYABLE(thread_pool)
/**
* Effects: creates a thread pool that runs closures on @c thread_count threads.
*/
thread_pool(unsigned const thread_count = thread_t::hardware_concurrency());
/**
* Effects: Destroys the thread pool.
* Synchronization: The completion of all the closures happen before the completion of the thread pool destructor.
*/
~thread_pool();
/**
* Effects: close the thread_pool for submissions. The worker threads will work until
*/
void close();
/**
* Returns: whether the pool is closed for submissions.
*/
bool is_close();
/**
* Effects: The specified function will be scheduled for execution at some point in the future.
* If invoking closure throws an exception the thread pool will call std::terminate, as is the case with threads.
* Synchronization: completion of closure on a particular thread happens before destruction of thread's thread local variables.
* Throws: sync_queue_is_closed if the thread pool is closed.
*
*/
template <typename Closure>
void submit(BOOST_THREAD_RV_REFClousure) closure);
/**
* This must be called from an scheduled task.
* Effects: reschedule functions until pred()
*/
template <typename Pred>
void reschedule_until(Pred const& pred);
};
Change History
(4)
Owner: |
changed from Anthony Williams to viboes
|
Status: |
new → assigned
|
Summary: |
Add a basic thread_pool executor. → Async: Add a basic thread_pool executor.
|
Milestone: |
To Be Determined → Boost 1.56.0
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Committed revision [85855],[85863].