27 Jul
2018
27 Jul
'18
5:58 a.m.
On 27/07/2018 14:13, hawk x wrote:
boost::coroutine and std::future are all excellent solutions for concurrency programming. But if there's many concurrent tasks, event-loop based multi-task in SINGLE thread will have the best performance.
coroutines can be used to manage concurrent tasks on a single thread. Boost.Asio is one way to manage those tasks with an event loop (simply have a single thread running the io_service/io_context); additional work can be posted both from "inside" and outside. Boost.Fiber (https://www.boost.org/doc/libs/1_67_0/libs/fiber/doc/html/index.html) is another way. This also supports futures, although not currently then-able ones.