class thread_queue
Declaration
template <typename Mutex,
typename PendingQueuing,
typename StagedQueuing,
typename TerminatedQueuing>
class thread_queue { /* full declaration omitted */ };Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:84
Member Variables
- protected static pika::detail::internal_allocator<task_description> task_description_alloc_
- ////////////////////////////////////////////////////////////////////////
Method Overview
- public void abort_all_suspended_threads()
- protected std::size_t add_new(std::int64_t add_count, thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing> * addfrom, std::unique_lock<mutex_type> & lk, bool steal = false)
- protected bool add_new_always(std::size_t & added, thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing> * addfrom, std::unique_lock<mutex_type> & lk, bool steal = false)
- public bool cleanup_terminated(bool delete_all = false)
- public bool cleanup_terminated_locked(bool delete_all = false)
- public void create_thread(pika::threads::thread_init_data & data, pika::threads::thread_id_ref_type * id, pika::error_code & ec)
- protected template <typename Lock>void create_thread_object(threads::thread_id_ref_type & thrd, threads::thread_init_data & data, Lock & lk)
- public static void deallocate(threads::thread_data * p)
- public void destroy_thread(threads::thread_data * thrd)
- public bool dump_suspended_threads(std::size_t num_thread, std::int64_t & idle_loop_count, bool running)
- public bool enumerate_threads(const util::function<bool (thread_id_type)> & f, pika::threads::thread_schedule_state state = thread_schedule_state::unknown) const
- public bool get_next_thread(threads::thread_id_ref_type & thrd, bool allow_stealing = false, bool steal = false)
- public std::int64_t get_pending_queue_length(std::memory_order order = std::memory_order_acquire) const
- public std::int64_t get_queue_length(std::memory_order order = std::memory_order_acquire) const
- public std::int64_t get_staged_queue_length(std::memory_order order = std::memory_order_acquire) const
- public std::int64_t get_thread_count(pika::threads::thread_schedule_state state = thread_schedule_state::unknown) const
- public constexpr void increment_num_pending_accesses(std::size_t = 1)
- public constexpr void increment_num_pending_misses(std::size_t = 1)
- public constexpr void increment_num_stolen_from_pending(std::size_t = 1)
- public constexpr void increment_num_stolen_from_staged(std::size_t = 1)
- public constexpr void increment_num_stolen_to_pending(std::size_t = 1)
- public constexpr void increment_num_stolen_to_staged(std::size_t = 1)
- public void move_task_items_from(thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing> * src, std::int64_t count)
- public void move_work_items_from(thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing> * src, std::int64_t count)
- public void on_error(std::size_t, const std::exception_ptr &)
- public void on_start_thread(std::size_t)
- public void on_stop_thread(std::size_t)
- protected void recycle_thread(pika::threads::thread_id_type thrd)
- public void schedule_thread(threads::thread_id_ref_type thrd, bool other_end = false)
- public thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>(std::size_t queue_num = unsigned long(-1), pika::threads::policies::thread_queue_init_parameters parameters = {})
- public inline bool wait_or_add_new(bool, std::size_t & added, bool steal = false)
- public inline bool wait_or_add_new(bool running, std::size_t & added, thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing> * addfrom, bool steal = false)
- public ~thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>()
Methods
void abort_all_suspended_threads()
void abort_all_suspended_threads()Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:918
std::size_t add_new(
std::int64_t add_count,
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* addfrom,
std::unique_lock<mutex_type>& lk,
bool steal = false)
std::size_t add_new(
std::int64_t add_count,
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* addfrom,
std::unique_lock<mutex_type>& lk,
bool steal = false)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:205
Parameters
- std::int64_t add_count
- thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>* addfrom
- std::unique_lock<mutex_type>& lk
- bool steal = false
bool add_new_always(
std::size_t& added,
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* addfrom,
std::unique_lock<mutex_type>& lk,
bool steal = false)
bool add_new_always(
std::size_t& added,
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* addfrom,
std::unique_lock<mutex_type>& lk,
bool steal = false)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:276
Parameters
- std::size_t& added
- thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>* addfrom
- std::unique_lock<mutex_type>& lk
- bool steal = false
bool cleanup_terminated(bool delete_all = false)
bool cleanup_terminated(bool delete_all = false)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:427
Parameters
- bool delete_all = false
bool cleanup_terminated_locked(
bool delete_all = false)
bool cleanup_terminated_locked(
bool delete_all = false)Description
This function makes sure all threads which are marked for deletion (state is terminated) are properly destroyed. This returns 'true' if there are no more terminated threads waiting to be deleted.
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:364
Parameters
- bool delete_all = false
void create_thread(
pika::threads::thread_init_data& data,
pika::threads::thread_id_ref_type* id,
pika::error_code& ec)
void create_thread(
pika::threads::thread_init_data& data,
pika::threads::thread_id_ref_type* id,
pika::error_code& ec)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:651
Parameters
template <typename Lock>
void create_thread_object(
threads::thread_id_ref_type& thrd,
threads::thread_init_data& data,
Lock& lk)
template <typename Lock>
void create_thread_object(
threads::thread_id_ref_type& thrd,
threads::thread_init_data& data,
Lock& lk)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:129
Parameters
- threads::thread_id_ref_type& thrd
- threads::thread_init_data& data
- Lock& lk
static void deallocate(threads::thread_data* p)
static void deallocate(threads::thread_data* p)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:488
Parameters
void destroy_thread(threads::thread_data* thrd)
void destroy_thread(threads::thread_data* thrd)Description
Destroy the passed thread as it has been terminated
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:873
Parameters
- threads::thread_data* thrd
bool dump_suspended_threads(
std::size_t num_thread,
std::int64_t& idle_loop_count,
bool running)
bool dump_suspended_threads(
std::size_t num_thread,
std::int64_t& idle_loop_count,
bool running)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:1098
Parameters
- std::size_t num_thread
- std::int64_t& idle_loop_count
- bool running
bool enumerate_threads(
const util::function<bool(thread_id_type)>& f,
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown) const
bool enumerate_threads(
const util::function<bool(thread_id_type)>& f,
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown) constDeclared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:939
Parameters
- const util::function<bool(thread_id_type)>& f
- pika::threads::thread_schedule_state state = thread_schedule_state::unknown
bool get_next_thread(
threads::thread_id_ref_type& thrd,
bool allow_stealing = false,
bool steal = false)
bool get_next_thread(
threads::thread_id_ref_type& thrd,
bool allow_stealing = false,
bool steal = false)Description
Return the next thread to be executed, return false if none is available
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:813
Parameters
- threads::thread_id_ref_type& thrd
- bool allow_stealing = false
- bool steal = false
std::int64_t get_pending_queue_length(
std::memory_order order =
std::memory_order_acquire) const
std::int64_t get_pending_queue_length(
std::memory_order order =
std::memory_order_acquire) constDeclared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:533
Parameters
- std::memory_order order = std::memory_order_acquire
std::int64_t get_queue_length(
std::memory_order order =
std::memory_order_acquire) const
std::int64_t get_queue_length(
std::memory_order order =
std::memory_order_acquire) constDescription
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:525
Parameters
- std::memory_order order = std::memory_order_acquire
std::int64_t get_staged_queue_length(
std::memory_order order =
std::memory_order_acquire) const
std::int64_t get_staged_queue_length(
std::memory_order order =
std::memory_order_acquire) constDeclared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:540
Parameters
- std::memory_order order = std::memory_order_acquire
std::int64_t get_thread_count(
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown) const
std::int64_t get_thread_count(
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown) constDescription
//////////////////////////////////////////////////////////////////// Return the number of existing threads with the given state.
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:888
Parameters
- pika::threads::thread_schedule_state state = thread_schedule_state::unknown
constexpr void increment_num_pending_accesses(
std::size_t = 1)
constexpr void increment_num_pending_accesses(
std::size_t = 1)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:628
Parameters
- std::size_t = 1
constexpr void increment_num_pending_misses(
std::size_t = 1)
constexpr void increment_num_pending_misses(
std::size_t = 1)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:625
Parameters
- std::size_t = 1
constexpr void increment_num_stolen_from_pending(
std::size_t = 1)
constexpr void increment_num_stolen_from_pending(
std::size_t = 1)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:631
Parameters
- std::size_t = 1
constexpr void increment_num_stolen_from_staged(
std::size_t = 1)
constexpr void increment_num_stolen_from_staged(
std::size_t = 1)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:635
Parameters
- std::size_t = 1
constexpr void increment_num_stolen_to_pending(
std::size_t = 1)
constexpr void increment_num_stolen_to_pending(
std::size_t = 1)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:639
Parameters
- std::size_t = 1
constexpr void increment_num_stolen_to_staged(
std::size_t = 1)
constexpr void increment_num_stolen_to_staged(
std::size_t = 1)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:643
Parameters
- std::size_t = 1
void move_task_items_from(
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* src,
std::int64_t count)
void move_task_items_from(
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* src,
std::int64_t count)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:777
Parameters
- thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>* src
- std::int64_t count
void move_work_items_from(
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* src,
std::int64_t count)
void move_work_items_from(
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* src,
std::int64_t count)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:752
Parameters
- thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>* src
- std::int64_t count
void on_error(std::size_t,
const std::exception_ptr&)
void on_error(std::size_t,
const std::exception_ptr&)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:1156
Parameters
- std::size_t
- const std::exception_ptr&
void on_start_thread(std::size_t)
void on_start_thread(std::size_t)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:1118
Parameters
void on_stop_thread(std::size_t)
void on_stop_thread(std::size_t)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:1155
Parameters
void recycle_thread(
pika::threads::thread_id_type thrd)
void recycle_thread(
pika::threads::thread_id_type thrd)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:326
Parameters
void schedule_thread(
threads::thread_id_ref_type thrd,
bool other_end = false)
void schedule_thread(
threads::thread_id_ref_type thrd,
bool other_end = false)Description
Schedule the passed thread
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:857
Parameters
- threads::thread_id_ref_type thrd
- bool other_end = false
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>(
std::size_t queue_num = unsigned long(-1),
pika::threads::policies::
thread_queue_init_parameters parameters =
{})
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>(
std::size_t queue_num = unsigned long(-1),
pika::threads::policies::
thread_queue_init_parameters parameters =
{})Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:450
Parameters
- std::size_t queue_num = unsigned long(-1)
- pika::threads::policies:: thread_queue_init_parameters parameters = {}
inline bool wait_or_add_new(bool,
std::size_t& added,
bool steal = false)
inline bool wait_or_add_new(bool,
std::size_t& added,
bool steal = false)Description
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).
Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:994
Parameters
- bool
- std::size_t& added
- bool steal = false
inline bool wait_or_add_new(
bool running,
std::size_t& added,
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* addfrom,
bool steal = false)
inline bool wait_or_add_new(
bool running,
std::size_t& added,
thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>* addfrom,
bool steal = false)Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:1019
Parameters
- bool running
- std::size_t& added
- thread_queue<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>* addfrom
- bool steal = false
~thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>()
~thread_queue<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>()Declared at: libs/pika/schedulers/include/pika/schedulers/thread_queue.hpp:493