Boost logo

Boost :

Subject: [boost] Boost Fiber & ASIO CPU spinning
From: Daniel Larimer (dlarimer_at_[hidden])
Date: 2016-12-26 15:57:26

I am attempting to combine Boost Fiber with Boost ASIO and am having very
poor results.


int main() {
   boost::asio::io_service io;
boost::fibers::asio::round_robin > ( io );;
   return 0;

This code should startup and then sleep, but instead it pegs the CPU at

The code I used for boost::fibers::asio::round_robin can be found here:

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.


Boost list run by bdawes at, gregod at, cpdaniel at, john at