Skip to content

futures::thread_pool

Executors / thread_pool

Defined in header <futures/executor/thread_pool.hpp>

class thread_pool;

A thread pool with the specified number of threads.

Public Classes

Name
class executor_type
A executor that sends tasks to the thread pool.

Public Functions

Member Functions Description
(constructor) Construct a thread pool.
(function)
get_executor (function)
join (function)

Public Functions

function thread_pool

Defined in header <futures/executor/thread_pool.hpp>

(1)
thread_pool();
(2)
thread_pool(unsigned int threads);
(3)
thread_pool(thread_pool &) = delete;
(4)
thread_pool(thread_pool &&) = delete;
  1. Construct a thread pool.
  2. Construct a thread pool with specified number of threads.
  3. Thread pools cannot be copied.
  4. Thread pools cannot be moved.

Exception Safety

Basic exception guarantee.

function get_executor

Defined in header <futures/executor/thread_pool.hpp>

executor_type
get_executor();

Exception Safety

Basic exception guarantee.

function join

Defined in header <futures/executor/thread_pool.hpp>

void
join();

Exception Safety

Basic exception guarantee.


Updated on 2023-01-04