Reputation: 13126
There are 3 thin threads with manual low-latency context switching in the Boost:
What is the difference between Coroutine1, Coroutine2 and Fiber in Boost?
Upvotes: 16
Views: 5327
Reputation: 2109
boost.coroutine is non-C++11 and therefore requires to use a private API from boost.context (reason because it is deprecated).
boost.coroutine2 and boost.fiber require C++11 and use callcc()/continuation (implements context switch, call-with-current-continuation) from boost.context.
boost.coroutine and boost.coroutine2 implement coroutines, while boost.fiber provides fibers (== lightweigt, coroperative userland-threads, green-threads, ...) with an API similar to std::thread.
The difference between coroutines and fibers is described in N4024: Distinguishing coroutines and fibers - in short: fibers are switched by an internal scheduler while coroutines use no internal scheduler.
Upvotes: 44