hpx/schedulers/local_queue_scheduler.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
threads
-
namespace
policies
Typedefs
-
using
default_local_queue_scheduler_terminated_queue
= lockfree_fifo¶
-
template<typename
Mutex
= std::mutex, typenamePendingQueuing
= lockfree_fifo, typenameStagedQueuing
= lockfree_fifo, typenameTerminatedQueuing
= default_local_queue_scheduler_terminated_queue>
classlocal_queue_scheduler
: public scheduler_base¶ - #include <local_queue_scheduler.hpp>
The local_queue_scheduler maintains exactly one queue of work items (threads) per OS thread, where this OS thread pulls its next work from.
Public Types
-
typedef thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>
thread_queue_type
¶
-
typedef init_parameter
init_parameter_type
¶
Public Functions
-
local_queue_scheduler
(init_parameter_type const &init, bool deferred_initialization = true)¶
-
virtual
~local_queue_scheduler
()¶
-
void
abort_all_suspended_threads
()¶
-
bool
cleanup_terminated
(bool delete_all)¶
-
void
create_thread
(thread_init_data &data, thread_id_ref_type *id, error_code &ec)¶
-
virtual bool
get_next_thread
(std::size_t num_thread, bool running, threads::thread_id_ref_type &thrd, bool)¶ Return the next thread to be executed, return false if none is available
-
void
schedule_thread
(threads::thread_id_ref_type thrd, threads::thread_schedule_hint schedulehint, bool allow_fallback, thread_priority = thread_priority::normal)¶ Schedule the passed thread.
-
void
schedule_thread_last
(threads::thread_id_ref_type thrd, threads::thread_schedule_hint schedulehint, bool allow_fallback, thread_priority = thread_priority::normal)¶
-
void
destroy_thread
(threads::thread_data *thrd)¶ Destroy the passed thread as it has been terminated.
-
std::int64_t
get_thread_count
(thread_schedule_state state = thread_schedule_state::unknown, thread_priority priority = thread_priority::default_, std::size_t num_thread = std::size_t(-1), bool = false) const¶
-
bool
enumerate_threads
(hpx::function<bool(thread_id_type)> const &f, thread_schedule_state state = thread_schedule_state::unknown, ) const¶
-
virtual bool
wait_or_add_new
(std::size_t num_thread, bool running, std::int64_t &idle_loop_count, bool, std::size_t &added)¶ This is a function which gets called periodically by the thread manager to allow for maintenance tasks to be executed in the scheduler. Returns true if the OS thread calling this function has to be terminated (i.e. no more work has to be done).
Protected Attributes
-
std::vector<thread_queue_type*>
queues_
¶
-
detail::affinity_data const &
affinity_data_
¶
-
mask_type
steals_in_numa_domain_
¶
-
mask_type
steals_outside_numa_domain_
¶
-
struct
init_parameter
¶ Public Functions
-
template<>
init_parameter
(std::size_t num_queues, detail::affinity_data const &affinity_data, thread_queue_init_parameters thread_queue_init = {}, char const *description = "local_queue_scheduler")¶
-
template<>
-
typedef thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>
-
using
-
namespace
-
namespace