Skip to content

Instantly share code, notes, and snippets.

@alz2
alz2 / fiber_asio_starvation.cc
Created April 28, 2021 04:53
Example where fiber yield and fiber sleep_for makes a difference.
#include <boost/asio.hpp>
#include <boost/fiber/all.hpp>
#include <chrono>
#include <memory>
#include "testing/experimental/round_robin/round_robin.hpp" // For asio round robin scheduler.
// Context:
// https://stackoverflow.com/questions/67276482/difference-between-boostfiberyield-and-boostfibersleep-for-when-using-fib
int main(int argc, char **argv) {