MCPcopy Create free account
hub / github.com/boostorg/cobalt / cpu_intense_work

Function cpu_intense_work

example/thread_pool.cpp:22–28  ·  view source on GitHub ↗

this is a function doing some CPU heavy work that should be offloaded onto a thread_pool

Source from the content-addressed store, hash-verified

20
21// this is a function doing some CPU heavy work that should be offloaded onto a thread_pool
22cobalt::promise<int> cpu_intense_work(
23 int a, int b,
24 boost::asio::executor_arg_t = {}, cobalt::executor = cobalt::this_thread::get_executor())
25 // ^set the executor manually. but default it so we can still use it with the thread_local one if present
26{
27 co_return a + b;
28}
29
30cobalt::task<void> work(int min_a, int max_a, int b)
31{

Callers 1

workFunction · 0.70

Calls 1

get_executorFunction · 0.85

Tested by

no test coverage detected