Loading...
Searching...
No Matches
|
| | DesktopPool (size_t count) |
| | Start the desktop worker pool.
|
| | ~DesktopPool () |
| | Wake and join the workers before destroying shared batch state.
|
| size_t | size () const |
| | Report the fixed worker capacity.
|
| size_t | peak_workers () |
| | Read the lifetime concurrency high-water mark.
|
| bool | cancelled () const |
| | Check whether the current batch has failed or been interrupted.
|
| void | run (size_t count, std::function< void(size_t)> operation, const std::function< void()> &checkpoint) |
| | Run indexed work and wait for every active callback to finish.
|
|
| void | work () |
| | Claim and execute jobs until the coordinator shuts down the pool.
|
Definition at line 150 of file pangea.cpp.
◆ DesktopPool()
| pangea_detail::DesktopPool::DesktopPool |
( |
size_t | count | ) |
|
|
inlineexplicit |
Start the desktop worker pool.
- Parameters
-
| count | Number of worker threads. |
Block termination signals while spawning so workers inherit the mask and shutdown remains the coordinator's responsibility.
Definition at line 193 of file pangea.cpp.
◆ ~DesktopPool()
| pangea_detail::DesktopPool::~DesktopPool |
( |
| ) |
|
|
inline |
Wake and join the workers before destroying shared batch state.
- Precondition
- No coordinator call to run is in progress.
Definition at line 218 of file pangea.cpp.
◆ cancelled()
| bool pangea_detail::DesktopPool::cancelled |
( |
| ) |
const |
|
inline |
Check whether the current batch has failed or been interrupted.
- Returns
- True when workers should stop at their next checkpoint.
Definition at line 237 of file pangea.cpp.
◆ peak_workers()
| size_t pangea_detail::DesktopPool::peak_workers |
( |
| ) |
|
|
inline |
Read the lifetime concurrency high-water mark.
- Returns
- Greatest number of simultaneously active jobs.
Definition at line 231 of file pangea.cpp.
◆ run()
| void pangea_detail::DesktopPool::run |
( |
size_t | count, |
|
|
std::function< void(size_t)> | operation, |
|
|
const std::function< void()> & | checkpoint ) |
|
inline |
Run indexed work and wait for every active callback to finish.
- Parameters
-
| count | Number of jobs. |
| operation | Worker callback; invocations may overlap. |
| checkpoint | Coordinator callback for resource and stop checks. |
Poll the checkpoint while waiting. Preserve the first failure and rethrow it only after callbacks no longer borrow batch state.
- Precondition
- One coordinator calls this method; it is not reentrant.
Definition at line 246 of file pangea.cpp.
◆ size()
| size_t pangea_detail::DesktopPool::size |
( |
| ) |
const |
|
inline |
Report the fixed worker capacity.
- Returns
- Number of threads, whether idle or active.
Definition at line 228 of file pangea.cpp.
◆ work()
| void pangea_detail::DesktopPool::work |
( |
| ) |
|
|
inlineprivate |
Claim and execute jobs until the coordinator shuts down the pool.
Execute callbacks outside the mutex. On failure, stop assigning jobs but let in-flight callbacks drain before the batch returns.
Definition at line 164 of file pangea.cpp.
◆ active
| size_t pangea_detail::DesktopPool::active = 0 |
|
private |
◆ cancel
| std::atomic<bool> pangea_detail::DesktopPool::cancel {false} |
|
private |
◆ completed
| std::condition_variable pangea_detail::DesktopPool::completed |
|
private |
◆ failure
| std::exception_ptr pangea_detail::DesktopPool::failure |
|
private |
◆ job_count
| size_t pangea_detail::DesktopPool::job_count = 0 |
|
private |
◆ mutex
| std::mutex pangea_detail::DesktopPool::mutex |
|
private |
◆ next_job
| size_t pangea_detail::DesktopPool::next_job = 0 |
|
private |
◆ peak_active
| size_t pangea_detail::DesktopPool::peak_active = 0 |
|
private |
◆ ready
| std::condition_variable pangea_detail::DesktopPool::ready |
|
private |
◆ shutdown
| bool pangea_detail::DesktopPool::shutdown = false |
|
private |
◆ task
| std::function<void(size_t)> pangea_detail::DesktopPool::task |
|
private |
◆ workers
| std::vector<std::thread> pangea_detail::DesktopPool::workers |
|
private |
The documentation for this class was generated from the following file: