xlr*_*lrg 33

boost.coroutine是非C++ 11,因此需要使用来自boost.context的私有API(因为它已被弃用).

boost.coroutine2boost.fiber需要C++ 11并使用来自boost.context的callcc()/ continuation(实现上下文切换,call-with-current-continuation).

boost.coroutineboost.coroutine2实现了协同程序,而boost.fiber提供了一个类似于std :: thread的光纤(== lightweigt,coroperative userland-threads,green-threads,...).

协同程序和光纤之间的区别在N4024中描述:区分协程和光纤 - 简而言之:光纤由内部调度程序切换,而协程不使用内部调度程序.