Coroutine demo source

后端 未结 3 1063
盖世英雄少女心
盖世英雄少女心 2021-01-07 02:54

Here\'s an example of a program, where coroutines really help to simplify the algorithm - imho its hardly possible to implement otherwise. I also tried to choose a useful ta

3条回答
  •  半阙折子戏
    2021-01-07 03:13

    Implementing coroutines portably its a difficult task. Please consider using Boost.coroutine candidate. Here are updates to the library.

    I've used it on OS X and Linux quite a bit together with boost::asio and they've proven to be very robustly implemented and a very useful abstraction of threads with the deterministic behavior of a sequential program

    I don't know why it hasn't yet been added to the main boost distribution. My guess is there some political argument disguised as a technical one behind that fact, although you are encouraged to take my paranoia with a grain of salt

    EDIT: there is a new boost candidate in the boost vault called Boost.Context, and its part of a larger library called Boost.Fiber. It doesn't have a webpage yet so i won't link it here. It seems to have better support

提交回复
热议问题