|
Foundation
|
Heap-resident shared state for a non-blocking ThreadPool::ParallelForAsync. More...
#include <ThreadPool.hpp>
Public Member Functions | |
| ParallelForAsyncState (Fn &&f, size_t t, Allocator *a) | |
Public Attributes | |
| Fn | fn |
| size_t | total {0} |
| Atomic< size_t > | cursor {0} |
| Atomic< size_t > | remaining {0} |
| Promise< void > | promise |
| Allocator * | alloc {nullptr} |
Heap-resident shared state for a non-blocking ThreadPool::ParallelForAsync.
Unlike the stack-resident ParallelForJob (whose lifetime is bounded by the blocking call), an async parallel-for must outlive the scheduling call: the caller returns immediately with a Future and does not participate. The functor, the shared cursor, the fork-join latch and the Promise all live here; the last worker to drain satisfies the promise and frees the state.
|
inline |
| Allocator* Foundation::Core::ParallelForAsyncState< Fn >::alloc {nullptr} |
| Atomic<size_t> Foundation::Core::ParallelForAsyncState< Fn >::cursor {0} |
| Fn Foundation::Core::ParallelForAsyncState< Fn >::fn |
| Promise<void> Foundation::Core::ParallelForAsyncState< Fn >::promise |
| Atomic<size_t> Foundation::Core::ParallelForAsyncState< Fn >::remaining {0} |
| size_t Foundation::Core::ParallelForAsyncState< Fn >::total {0} |