hpx/threading_base/thread_pool_base.hpp#

Defined in header hpx/threading_base/thread_pool_base.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace threads

Functions

std::ostream &operator<<(std::ostream &os, thread_pool_base const &thread_pool)#
class thread_pool_base#
#include <thread_pool_base.hpp>

The base class used to manage a pool of OS threads.

Public Functions

virtual void suspend_processing_unit_direct(std::size_t virt_core, error_code &ec = throws) = 0#

Suspends the given processing unit. Blocks until the processing unit has been suspended.

Parameters
  • virt_core – [in] The processing unit on the the pool to be suspended. The processing units are indexed starting from 0.

  • ec – [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

virtual void resume_processing_unit_direct(std::size_t virt_core, error_code &ec = throws) = 0#

Resumes the given processing unit. Blocks until the processing unit has been resumed.

Parameters
  • virt_core – [in] The processing unit on the the pool to be resumed. The processing units are indexed starting from 0.

  • ec – [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

virtual void resume_direct(error_code &ec = throws) = 0#

Resumes the thread pool. Blocks until all OS threads on the thread pool have been resumed.

Parameters

ec – [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

virtual void suspend_direct(error_code &ec = throws) = 0#

Suspends the thread pool. Blocks until all OS threads on the thread pool have been suspended.

Note

A thread pool cannot be suspended from an HPX thread running on the pool itself.

Parameters

ec – [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

Throws

hpx::exception – if called from an HPX thread which is running on the pool itself.

struct thread_pool_init_parameters#

Public Functions

inline thread_pool_init_parameters(std::string const &name, std::size_t index, policies::scheduler_mode mode, std::size_t num_threads, std::size_t thread_offset, hpx::threads::policies::callback_notifier &notifier, hpx::threads::policies::detail::affinity_data const &affinity_data, hpx::threads::detail::network_background_callback_type const &network_background_callback = hpx::threads::detail::network_background_callback_type(), std::size_t max_background_threads = static_cast<std::size_t>(-1), std::size_t max_idle_loop_count = HPX_IDLE_LOOP_COUNT_MAX, std::size_t max_busy_loop_count = HPX_BUSY_LOOP_COUNT_MAX, std::size_t shutdown_check_count = 10)#

Public Members

std::string const &name_#
std::size_t index_#
policies::scheduler_mode mode_#
std::size_t num_threads_#
std::size_t thread_offset_#
hpx::threads::policies::callback_notifier &notifier_#
hpx::threads::policies::detail::affinity_data const &affinity_data_#
hpx::threads::detail::network_background_callback_type const &network_background_callback_#
std::size_t max_background_threads_#
std::size_t max_idle_loop_count_#
std::size_t max_busy_loop_count_#
std::size_t shutdown_check_count_#