Boost Fiber & ASIO CPU spinning

I am attempting to combine Boost Fiber with Boost ASIO and am having very poor results. Code: int main() { boost::asio::io_service io; boost::fibers::use_scheduling_algorithm< boost::fibers::asio::round_robin > ( io ); io.run(); return 0; } This code should startup and then sleep, but instead it pegs the CPU at 100%. The code I used for boost::fibers::asio::round_robin can be found here: http://www.boost.org/doc/libs/1_62_0/libs/fiber/examples/asio/round_robin.hp... When I inspect the round_robin scheduler it appears to be switching back and forth between two different fibers. If I put a print statement inside asio_rr_service_lambda then it constantly reports that it has ready fibers. I'm looking for a working example. Dan

2016-12-26 21:57 GMT+01:00 Daniel Larimer
participants (2)
-
Daniel Larimer
-
Oliver Kowalke