NumericAL
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
numerical::detail::pool_job Struct Reference

One parallel_for handed to the pool: its chunks, the next one to take, and how many are done. Each run has its own, so a worker still leaving one run never touches the next. More...

#include <parallel.hpp>

Public Member Functions

void work () noexcept
 Takes chunks until none is left, keeping the exception each throws.
 

Public Attributes

chunk_runner run {}
 The chunk runner.
 
const void * body {}
 The body it is handed.
 
std::size_t count {}
 The number of iterations.
 
std::size_t chunk {}
 Indices per chunk.
 
std::size_t chunks {}
 Chunks.
 
std::size_t helpers {}
 The workers that may join it beside the caller.
 
std::size_t core {no_core}
 The caller's core: its worker sits it out (sits_out).
 
std::atomic< std::size_t > joined {0}
 The workers that asked to.
 
std::atomic< std::size_t > next {0}
 The next chunk to take.
 
std::atomic< std::size_t > finished {0}
 The chunks done.
 
std::mutex lock
 Orders the last chunk's signal against the caller's sleep.
 
std::condition_variable done
 Signalled when the last chunk finishes.
 
std::vector< std::exception_ptr > failed
 The exception of each chunk, if it threw.
 

Detailed Description

One parallel_for handed to the pool: its chunks, the next one to take, and how many are done. Each run has its own, so a worker still leaving one run never touches the next.

Definition at line 243 of file parallel.hpp.

Member Function Documentation

◆ work()

void numerical::detail::pool_job::work ( )
inlinenoexcept

Takes chunks until none is left, keeping the exception each throws.

Definition at line 260 of file parallel.hpp.

Member Data Documentation

◆ body

const void* numerical::detail::pool_job::body {}

The body it is handed.

Definition at line 246 of file parallel.hpp.

◆ chunk

std::size_t numerical::detail::pool_job::chunk {}

Indices per chunk.

Definition at line 248 of file parallel.hpp.

◆ chunks

std::size_t numerical::detail::pool_job::chunks {}

Chunks.

Definition at line 249 of file parallel.hpp.

◆ core

std::size_t numerical::detail::pool_job::core {no_core}

The caller's core: its worker sits it out (sits_out).

Definition at line 251 of file parallel.hpp.

◆ count

std::size_t numerical::detail::pool_job::count {}

The number of iterations.

Definition at line 247 of file parallel.hpp.

◆ done

std::condition_variable numerical::detail::pool_job::done

Signalled when the last chunk finishes.

Definition at line 256 of file parallel.hpp.

◆ failed

std::vector<std::exception_ptr> numerical::detail::pool_job::failed

The exception of each chunk, if it threw.

Definition at line 257 of file parallel.hpp.

◆ finished

std::atomic<std::size_t> numerical::detail::pool_job::finished {0}

The chunks done.

Definition at line 254 of file parallel.hpp.

◆ helpers

std::size_t numerical::detail::pool_job::helpers {}

The workers that may join it beside the caller.

Definition at line 250 of file parallel.hpp.

◆ joined

std::atomic<std::size_t> numerical::detail::pool_job::joined {0}

The workers that asked to.

Definition at line 252 of file parallel.hpp.

◆ lock

std::mutex numerical::detail::pool_job::lock

Orders the last chunk's signal against the caller's sleep.

Definition at line 255 of file parallel.hpp.

◆ next

std::atomic<std::size_t> numerical::detail::pool_job::next {0}

The next chunk to take.

Definition at line 253 of file parallel.hpp.

◆ run

chunk_runner numerical::detail::pool_job::run {}

The chunk runner.

Definition at line 245 of file parallel.hpp.


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