20 std::cout <<
"Example 1: bounded_channel with TaskGroup\n";
28 for (
int i = 1; i <= 8; ++i)
38 out.push_back(*item * *item);
52 std::cout <<
"Squares:";
55 std::cout <<
"\nProcessed count: "
59 std::cout <<
"Example 2: cancellation-aware recv\n";
66 std::cout <<
"unexpected success\n";
70 std::cout <<
"recv interrupted by cancellation\n";
73 std::cout <<
"\nExample 3: spsc_queue handoff\n";
78 auto second =
handoff.try_pop();
79 std::cout <<
"Popped:";
80 if (first.has_value())
81 std::cout <<
" " << *first;
82 if (second.has_value())
83 std::cout <<
" " << *second;
size_t size_t int32_t value
size_t size_t int32_t * out
Bounded blocking channel for producer-consumer workflows.
Cooperative cancellation source paired with CancellationToken.
CancellationToken token() const noexcept
Return a token observing this source.
void request_cancel() noexcept
Request cancellation for all derived tokens.
Read/write-lock protected shared object wrapper.
Bounded single-producer/single-consumer queue.
Mutex-protected shared object wrapper.
Minimal structured-concurrency helper over ThreadPool futures.
A reusable thread pool for efficient parallel task execution.
Exception thrown when cooperative cancellation is observed.
Modern synchronization helpers for channels, shared state, and small producer-consumer queues.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Itor2 copy(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg)
Copy elements from one range to another.
A modern, efficient thread pool for parallel task execution.