hpx/thread_pool_util/thread_pool_suspension_helpers.hpp
hpx/thread_pool_util/thread_pool_suspension_helpers.hpp#
Defined in header hpx/thread_pool_util/thread_pool_suspension_helpers.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace hpx
-
namespace threads
Functions
-
hpx::future<void> resume_processing_unit(thread_pool_base &pool, std::size_t virt_core)#
Resumes the given processing unit. When the processing unit has been resumed the returned future will be ready.
Note
Can only be called from an HPX thread. Use resume_processing_unit_cb or to resume the processing unit from outside HPX. Requires that the pool has threads::policies::enable_elasticity set.
- Parameters
pool – [in] The thread pool to resume a processing unit on.
virt_core – [in] The processing unit on the pool to be resumed. The processing units are indexed starting from 0.
- Returns
A
future<void>
which is ready when the given processing unit has been resumed.
-
void resume_processing_unit_cb(thread_pool_base &pool, hpx::function<void()> callback, std::size_t virt_core, error_code &ec = throws)#
Resumes the given processing unit. Takes a callback as a parameter which will be called when the processing unit has been resumed.
Note
Requires that the pool has threads::policies::enable_elasticity set.
- Parameters
pool – [in] The thread pool to resume a processing unit on.
callback – [in] Callback which is called when the processing unit has been suspended.
virt_core – [in] The processing unit to resume.
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.
-
hpx::future<void> suspend_processing_unit(thread_pool_base &pool, std::size_t virt_core)#
Suspends the given processing unit. When the processing unit has been suspended the returned future will be ready.
Note
Can only be called from an HPX thread. Use suspend_processing_unit_cb or to suspend the processing unit from outside HPX. Requires that the pool has threads::policies::enable_elasticity set.
- Parameters
pool – [in] The thread pool to suspend a processing unit from.
virt_core – [in] The processing unit on the pool to be suspended. The processing units are indexed starting from 0.
- Throws
- Returns
A
future<void>
which is ready when the given processing unit has been suspended.
-
void suspend_processing_unit_cb(hpx::function<void()> callback, thread_pool_base &pool, std::size_t virt_core, error_code &ec = throws)#
Suspends the given processing unit. Takes a callback as a parameter which will be called when the processing unit has been suspended.
Note
Requires that the pool has threads::policies::enable_elasticity set.
- Parameters
pool – [in] The thread pool to suspend a processing unit from.
callback – [in] Callback which is called when the processing unit has been suspended.
virt_core – [in] The processing unit to suspend.
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.
-
hpx::future<void> resume_pool(thread_pool_base &pool)#
Resumes the thread pool. When the all OS threads on the thread pool have been resumed the returned future will be ready.
Note
Can only be called from an HPX thread. Use resume_cb or resume_direct to suspend the pool from outside HPX.
-
void resume_pool_cb(thread_pool_base &pool, hpx::function<void()> callback, error_code &ec = throws)#
Resumes the thread pool. Takes a callback as a parameter which will be called when all OS threads on the thread pool have been resumed.
- Parameters
pool – [in] The thread pool to resume.
callback – [in] called when the thread pool has been resumed.
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.
-
hpx::future<void> suspend_pool(thread_pool_base &pool)#
Suspends the thread pool. When the all OS threads on the thread pool have been suspended the returned future will be ready.
Note
Can only be called from an HPX thread. Use suspend_cb or suspend_direct to suspend the pool from outside HPX. A thread pool cannot be suspended from an HPX thread running on the pool itself.
-
void suspend_pool_cb(thread_pool_base &pool, hpx::function<void()> callback, error_code &ec = throws)#
Suspends the thread pool. Takes a callback as a parameter which will be called when 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
pool – [in] The thread pool to suspend.
callback – [in] called when the thread pool has been suspended.
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.
-
hpx::future<void> resume_processing_unit(thread_pool_base &pool, std::size_t virt_core)#
-
namespace threads