hpx/io_service/io_service_pool.hpp
hpx/io_service/io_service_pool.hpp#
Defined in header hpx/io_service/io_service_pool.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace hpx
-
namespace util
-
class io_service_pool#
- #include <io_service_pool.hpp>
A pool of io_service objects.
Public Functions
-
HPX_NON_COPYABLE(io_service_pool)#
-
explicit io_service_pool(std::size_t pool_size = 2, threads::policies::callback_notifier const ¬ifier = threads::policies::callback_notifier(), char const *pool_name = "", char const *name_postfix = "")#
Construct the io_service pool.
- Parameters
pool_size – [in] The number of threads to run to serve incoming requests
notifier – [in]
pool_name – [in]
name_postfix – [in]
-
explicit io_service_pool(threads::policies::callback_notifier const ¬ifier, char const *pool_name = "", char const *name_postfix = "")#
Construct the io_service pool.
- Parameters
notifier – [in]
pool_name – [in]
name_postfix – [in]
-
~io_service_pool()#
-
bool run(bool join_threads = true, barrier *startup = nullptr)#
Run all io_service objects in the pool. If join_threads is true this will also wait for all threads to complete
-
bool run(std::size_t num_threads, bool join_threads = true, barrier *startup = nullptr)#
Run all io_service objects in the pool. If join_threads is true this will also wait for all threads to complete
-
void stop()#
Stop all io_service objects in the pool.
-
void join()#
Join all io_service threads in the pool.
-
void clear()#
Clear all internal data structures.
-
void wait()#
Wait for all work to be done.
-
bool stopped()#
-
asio::io_context &get_io_service(int index = -1)#
Get an io_service to use.
-
inline constexpr std::size_t size() const noexcept#
Get number of threads associated with this I/O service.
-
void thread_run(std::size_t index, barrier *startup = nullptr) const#
Activate the thread index for this thread pool.
-
inline constexpr char const *get_name() const noexcept#
Return name of this pool.
Protected Functions
-
void stop_locked()#
-
void join_locked()#
-
void clear_locked()#
-
void wait_locked()#
Private Types
-
HPX_NON_COPYABLE(io_service_pool)#
-
class io_service_pool#
-
namespace util