work 0.1.0
A gig is a bunch of related work. The pool does the work.
Loading...
Searching...
No Matches
work Module Reference

Concepts

concept  work::task
 Tasks can move between workers without throwing.
concept  work::handler_for
 A handler consumes a task, optionally with a borrowed child-submission context.

Classes

class  work::context< T >
 Borrowed owner-local submissions; valid only during its handler call. Children are accepted after close(): they belong to the already accepted task. Never share this context with another thread or retain it after the callback. More...
class  work::gig< T, Handler >
 A typed, nonmovable lifetime boundary for submitted tasks and descendants. Each accepted task runs exactly once. close() is idempotent and rejects later external pushes; contexts may still create children. join() closes and waits for all descendants, publishing their writes to the caller. Destruction joins. push() and close() may race: the gig mutex determines whether push is accepted. The handler and all borrowed captures must remain valid until join returns. More...
struct  work::gig_options
 Bound a gig's concurrency or keep all its callbacks on the joining caller. More...
class  work::pool
 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...

Files

file  src/work.ccm
 Typed gigs with private stacks and stochastic work pushing.