work 0.1.0
A gig is a bunch of related work. The pool does the work.
Loading...
Searching...
No Matches
work::pool Class Referenceexport
module work

Persistent workers shared by independent, overlapping typed gigs. The width includes one cooperating join caller; width one needs join() to make progress. A pool must outlive every gig made from it. Callbacks should not block waiting for other pool work: join() cooperates instead. More...

Public Member Functions

 pool (std::size_t workers=1) noexcept
 Create a pool whose width includes the joining caller.
 ~pool () noexcept
std::size_t workers () const noexcept
 Maximum number of lanes in a gig by default.
std::size_t available_workers () const noexcept
 Preserve caller-only execution for nested bulk phases.
template<task T, class Handler>
requires handler_for<std::decay_t<Handler>, T>
auto gig (Handler &&handler, gig_options options={}) noexcept
 Create a typed gig. Handler invocations may overlap and must be thread safe.

Friends

template<task T, class Handler>
class work::gig

Detailed Description

Persistent workers shared by independent, overlapping typed gigs. The width includes one cooperating join caller; width one needs join() to make progress. A pool must outlive every gig made from it. Callbacks should not block waiting for other pool work: join() cooperates instead.

Definition at line 83 of file work.ccm.

Constructor & Destructor Documentation

◆ ~pool()

work::pool::~pool ( )
noexcept
Precondition
All gigs have been destroyed.

Definition at line 396 of file work.ccm.


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