|
work 0.1.0
A gig is a bunch of related work. The pool does the 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 |
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.
|
noexcept |