Ale*_*lex 9 c++ multithreading boost boost-asio c++11
在Boost中有3个具有手动低延迟上下文切换的细线程:
Coroutine1,Coroutine2和Boost中的Fiber之间有什么区别?
xlr*_*lrg 33
boost.coroutine是非C++ 11,因此需要使用来自boost.context的私有API(因为它已被弃用).
boost.coroutine2和boost.fiber需要C++ 11并使用来自boost.context的callcc()/ continuation(实现上下文切换,call-with-current-continuation).
boost.coroutine和boost.coroutine2实现了协同程序,而boost.fiber提供了一个类似于std :: thread的光纤(== lightweigt,coroperative userland-threads,green-threads,...).
协同程序和光纤之间的区别在N4024中描述:区分协程和光纤 - 简而言之:光纤由内部调度程序切换,而协程不使用内部调度程序.