24#if ALEPH_HAS_EXPERIMENTAL_ASYNC
31#if ALEPH_HAS_EXPERIMENTAL_ASYNC
47 std::coroutine_handle<promise_type>::from_promise(*
this));
55 promise_.set_value(std::move(value));
60 promise_.set_exception(std::current_exception());
65 std::coroutine_handle<promise_type>
handle_;
107 const int left =
co_await experimental::schedule(pool, [] {
return 20; });
108 const int right =
co_await experimental::schedule(pool, [left] {
118#if ALEPH_HAS_EXPERIMENTAL_ASYNC
121 auto greeting = experimental::schedule(pool, [] {
122 return std::string(
"hello from the experimental async bridge");
125 std::cout <<
greeting.get() <<
"\n";
126 std::cout <<
"coroutine chain result: " <<
coroutine_chain(pool).get() <<
"\n";
128 auto default_result = experimental::schedule([] {
return 7 * 6; });
129 std::cout <<
"default pool result: " <<
default_result.get() <<
"\n";
132 <<
"Experimental async bridge is disabled.\n"
133 <<
"Reconfigure with -DALEPH_ENABLE_EXPERIMENTAL_ASYNC=ON and use C++20.\n";
A reusable thread pool for efficient parallel task execution.
Opt-in experimental coroutine-friendly bridge over ThreadPool.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::decay_t< typename HeadC::Item_Type > T
A modern, efficient thread pool for parallel task execution.