3 ms·
Yes. The mediator in this case is the scheduler. The one that actually calls the asynchronous block. Potentially retrying it if it fails. In the OP’s code, ther
by gabereiser 3y ago
Yes. The mediator in this case is the scheduler. The one that actually calls the asynchronous block. Potentially retrying it if it fails. In the OP’s code, there’s atomic blocks, sequential execution of blocks, stateful blocks, etc for ensuring singular access at a time.
The meat here is scheduler.cpp. It uses std::coroutines.
This is like async/await in other languages. The scheduler has a queue of work(coroutines) and a pool of threads(N>0) to execute those on.
In this case, messages are passed between work that contains the data. No locks are required at the expense of memory footprint.
- schmichael 3y agoThanks! So the scheduler serializes execution of critical sections? > In this case, messages are passed between work that contains the data. No locks are required at the expense of memory footprint. Are messages copied or moved? If moved is there compile time checking for ownership or runtime debugging tools?
- gabereiser 3y agohttps://en.cppreference.com/w/cpp/language/coroutines https://en.cppreference.com/w/cpp/language/coroutines