Class to define a work item returning a variable. More...
#include <ThreadPool.h>

Public Member Functions | |
| void | add_dependencies (const std::vector< ThreadPoolID > &ids) |
| Add a list of work item to the list of dependencies. | |
| void | add_dependencies (std::size_t N, const ThreadPoolID *ids) |
| Add a list of work item to the list of dependencies Note: this function is thread-safe for the threadpool and does not need blocking. | |
| void | add_dependency (const ThreadPoolID &id) |
| Add a work item to the list of dependencies. | |
| std::vector< ThreadPoolID > | get_dependencies () const |
| Return the list of work ids that we depend on. | |
| std::size_t | get_N_dependencies () const |
| Get the number of work ids that this work item depends on. | |
| return_type | get_results () const |
| Return the results. | |
| auto | getStatus () const |
| Get the current status. | |
| virtual bool | has_result () const override final |
| Will the routine return a result. | |
| virtual void | run () override=0 |
| Run the work item. | |
| virtual | ~WorkItemRet () |
| Virtual destructor. | |
Protected Member Functions | |
| WorkItemRet () | |
Protected Attributes | |
| return_type | d_result |
Private Member Functions | |
| WorkItemRet & | operator= (const WorkItemRet &) |
| WorkItemRet (const WorkItemRet &) | |
Private Attributes | |
| volatile std::atomic_int32_t | d_count |
| ThreadPoolID * | d_ids |
| uint16_t | d_N_ids |
| uint16_t | d_size |
| volatile ThreadPoolID::Status | d_state |
Class to define a work item returning a variable.
This is the class that defines a work item to be processed. Users may derive their own class and add work using the add_work routine, or can use the TPOOL_ADD_WORK macro. Note: this class is templated on the return argument type and may be a void type.
Definition at line 70 of file ThreadPool.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 80 of file ThreadPool.h.
|
inlineprotected |
Definition at line 84 of file ThreadPool.h.
|
private |
|
inlineinherited |
Add a list of work item to the list of dependencies.
| ids | Ids of the work item to add |
Definition at line 45 of file ThreadPoolWorkItem.h.
References AMP::ThreadPoolWorkItem::add_dependencies().
Referenced by AMP::ThreadPoolWorkItem::add_dependencies(), and AMP::ThreadPoolWorkItem::add_dependency().
|
inherited |
Add a list of work item to the list of dependencies Note: this function is thread-safe for the threadpool and does not need blocking.
| N | Number of items to add |
| ids | Ids of the work item to add |
|
inlineinherited |
Add a work item to the list of dependencies.
| id | Id of the work item to add |
Definition at line 40 of file ThreadPoolWorkItem.h.
References AMP::ThreadPoolWorkItem::add_dependencies().
|
inherited |
Return the list of work ids that we depend on.
|
inlineinherited |
Get the number of work ids that this work item depends on.
Definition at line 33 of file ThreadPoolWorkItem.h.
References AMP::ThreadPoolWorkItem::d_N_ids.
|
inline |
Return the results.
Definition at line 78 of file ThreadPool.h.
References AMP::ThreadPool::WorkItemRet< return_type >::d_result.
|
inlineinherited |
Get the current status.
Definition at line 59 of file ThreadPoolWorkItem.h.
References AMP::ThreadPoolWorkItem::d_state.
|
inlinefinaloverridevirtual |
Will the routine return a result.
Implements AMP::ThreadPoolWorkItem.
Definition at line 76 of file ThreadPool.h.
|
private |
|
overridepure virtual |
Run the work item.
Implements AMP::ThreadPoolWorkItem.
|
privateinherited |
Definition at line 78 of file ThreadPoolWorkItem.h.
|
privateinherited |
Definition at line 79 of file ThreadPoolWorkItem.h.
Referenced by AMP::ThreadPoolWorkItem::~ThreadPoolWorkItem().
|
privateinherited |
Definition at line 76 of file ThreadPoolWorkItem.h.
Referenced by AMP::ThreadPoolWorkItem::get_N_dependencies(), and AMP::ThreadPoolWorkItem::~ThreadPoolWorkItem().
|
protected |
Definition at line 82 of file ThreadPool.h.
Referenced by AMP::ThreadPool::WorkItemRet< return_type >::get_results().
|
privateinherited |
Definition at line 77 of file ThreadPoolWorkItem.h.
Referenced by AMP::ThreadPoolWorkItem::~ThreadPoolWorkItem().
|
privateinherited |
Definition at line 75 of file ThreadPoolWorkItem.h.
Referenced by AMP::ThreadPoolWorkItem::getStatus().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |