Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AMP::ThreadPoolHeapQueue Class Reference

Class to store the queue for the ThreadPool using a binary heap. More...

#include <ThreadPoolQueue.h>

Public Member Functions

size_t capacity () const
 The number of items that can be in the queue.
 
void changePriorities (const std::vector< std::pair< uint64_t, int8_t > > &list)
 Change the prioirties of items in the queue.
 
bool empty () const
 Check if the queue is empty.
 
void insert (size_t N, const ThreadPoolID *ids)
 Add the given items to the queue.
 
ThreadPoolHeapQueueoperator= (const ThreadPoolHeapQueue &)=delete
 Asignment operator.
 
ThreadPoolID pop ()
 Get the next item to process.
 
size_t size () const
 The number of items that are in the queue.
 
 ThreadPoolHeapQueue ()=delete
 Empty constructor.
 
 ThreadPoolHeapQueue (const ThreadPoolHeapQueue &)=delete
 Copy constructor.
 
 ThreadPoolHeapQueue (size_t N)
 Default constructor.
 

Private Member Functions

void checkBlocked ()
 
void lock ()
 
void unlock ()
 

Private Attributes

volatile ThreadPoolIDd_ids
 
volatile std::atomic_int32_t d_lock
 
volatile size_t d_Nb
 
const size_t d_Nc
 
volatile size_t d_Nh
 

Detailed Description

Class to store the queue for the ThreadPool using a binary heap.

Definition at line 77 of file ThreadPoolQueue.h.

Constructor & Destructor Documentation

◆ ThreadPoolHeapQueue() [1/3]

AMP::ThreadPoolHeapQueue::ThreadPoolHeapQueue ( )
delete

Empty constructor.

◆ ThreadPoolHeapQueue() [2/3]

AMP::ThreadPoolHeapQueue::ThreadPoolHeapQueue ( size_t  N)
inlineexplicit

Default constructor.

Definition at line 84 of file ThreadPoolQueue.h.

◆ ThreadPoolHeapQueue() [3/3]

AMP::ThreadPoolHeapQueue::ThreadPoolHeapQueue ( const ThreadPoolHeapQueue )
delete

Copy constructor.

Member Function Documentation

◆ capacity()

size_t AMP::ThreadPoolHeapQueue::capacity ( ) const
inline

The number of items that can be in the queue.

Definition at line 96 of file ThreadPoolQueue.h.

References d_Nc.

◆ changePriorities()

void AMP::ThreadPoolHeapQueue::changePriorities ( const std::vector< std::pair< uint64_t, int8_t > > &  list)
inline

Change the prioirties of items in the queue.

Definition at line 145 of file ThreadPoolQueue.h.

References d_ids, d_Nb, d_Nc, d_Nh, AMP::ThreadPoolID::getLocalID(), lock(), and unlock().

◆ checkBlocked()

void AMP::ThreadPoolHeapQueue::checkBlocked ( )
inlineprivate

Definition at line 192 of file ThreadPoolQueue.h.

References d_ids, d_Nb, d_Nc, d_Nh, and AMP::test().

Referenced by pop().

◆ empty()

bool AMP::ThreadPoolHeapQueue::empty ( ) const
inline

Check if the queue is empty.

Definition at line 102 of file ThreadPoolQueue.h.

References size().

◆ insert()

void AMP::ThreadPoolHeapQueue::insert ( size_t  N,
const ThreadPoolID ids 
)
inline

Add the given items to the queue.

Definition at line 120 of file ThreadPoolQueue.h.

References d_ids, d_Nb, d_Nc, d_Nh, lock(), and unlock().

◆ lock()

void AMP::ThreadPoolHeapQueue::lock ( )
inlineprivate

Definition at line 180 of file ThreadPoolQueue.h.

References d_lock.

Referenced by changePriorities(), insert(), and pop().

◆ operator=()

ThreadPoolHeapQueue & AMP::ThreadPoolHeapQueue::operator= ( const ThreadPoolHeapQueue )
delete

Asignment operator.

◆ pop()

ThreadPoolID AMP::ThreadPoolHeapQueue::pop ( )
inline

Get the next item to process.

Definition at line 105 of file ThreadPoolQueue.h.

References checkBlocked(), d_ids, d_Nh, lock(), and unlock().

◆ size()

size_t AMP::ThreadPoolHeapQueue::size ( ) const
inline

The number of items that are in the queue.

Definition at line 99 of file ThreadPoolQueue.h.

References d_Nb, and d_Nh.

Referenced by empty().

◆ unlock()

void AMP::ThreadPoolHeapQueue::unlock ( )
inlineprivate

Definition at line 187 of file ThreadPoolQueue.h.

References d_lock.

Referenced by changePriorities(), insert(), and pop().

Member Data Documentation

◆ d_ids

volatile ThreadPoolID* AMP::ThreadPoolHeapQueue::d_ids
private

Definition at line 215 of file ThreadPoolQueue.h.

Referenced by changePriorities(), checkBlocked(), insert(), and pop().

◆ d_lock

volatile std::atomic_int32_t AMP::ThreadPoolHeapQueue::d_lock
private

Definition at line 211 of file ThreadPoolQueue.h.

Referenced by lock(), and unlock().

◆ d_Nb

volatile size_t AMP::ThreadPoolHeapQueue::d_Nb
private

Definition at line 214 of file ThreadPoolQueue.h.

Referenced by changePriorities(), checkBlocked(), insert(), and size().

◆ d_Nc

const size_t AMP::ThreadPoolHeapQueue::d_Nc
private

Definition at line 212 of file ThreadPoolQueue.h.

Referenced by capacity(), changePriorities(), checkBlocked(), and insert().

◆ d_Nh

volatile size_t AMP::ThreadPoolHeapQueue::d_Nh
private

Definition at line 213 of file ThreadPoolQueue.h.

Referenced by changePriorities(), checkBlocked(), insert(), pop(), and size().


The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page