![]() |
The Gaudi Framework
master (9f3f8895)
|
The FiberManager manages a pool of threads used to run boost::fiber fibers. More...
#include </builds/gaudi/Gaudi/GaudiHive/src/FiberManager.h>

Public Member Functions | |
| FiberManager (int n_threads, std::size_t stackSize=16ULL *1024 *1024) | |
| FiberManager constructor. | |
| ~FiberManager () | |
| template<typename F> | |
| void | schedule (F &&func) |
| Schedule work to run on the asynchronous pool. | |
Private Types | |
| using | StackAlloc = boost::fibers::fixedsize_stack |
| Stack allocator used for fibers. | |
| using | SchedAlgo = boost::fibers::algo::shared_work |
Private Attributes | |
| boost::fibers::condition_variable | m_shuttingDown_cv {} |
| boost::fibers::mutex | m_shuttingDown_mtx {} |
| std::vector< std::jthread > | m_threads {} |
| std::vector< SchedAlgo * > | m_schedAlgoList {} |
| std::size_t | m_stackSize |
| Stack size for fibers – virtual memory so this is not consume. | |
The FiberManager manages a pool of threads used to run boost::fiber fibers.
These fibers can be suspended while waiting for GPU operations (with CUDA and HIP support built-in), remote I/O operations, and the like, providing a base for asynchronous algorithm support.
Definition at line 33 of file FiberManager.h.
|
private |
Definition at line 75 of file FiberManager.h.
|
private |
Stack allocator used for fibers.
Definition at line 74 of file FiberManager.h.
| FiberManager::FiberManager | ( | int | n_threads, |
| std::size_t | stackSize = 16ULL * 1024 * 1024 ) |
FiberManager constructor.
| n_threads | Number of threads for CPU portion of asynchronous algorithms. These are in addition to the TBB worker threads used for CPU algorithms. |
Definition at line 18 of file FiberManager.cpp.
| FiberManager::~FiberManager | ( | ) |
Definition at line 49 of file FiberManager.cpp.
|
inline |
Schedule work to run on the asynchronous pool.
AsynchronousAlgorithms should use a relatively small amount of CPU time, and should use boost::fiber functionality to yield while waiting for offloaded work to complete.
| func | The AlgTask, when used in AvalancheSchedulerSvc |
Definition at line 63 of file FiberManager.h.
|
private |
Definition at line 79 of file FiberManager.h.
|
private |
Definition at line 76 of file FiberManager.h.
|
private |
Definition at line 77 of file FiberManager.h.
|
private |
Stack size for fibers – virtual memory so this is not consume.
Definition at line 82 of file FiberManager.h.
|
private |
Definition at line 78 of file FiberManager.h.