Le 11/01/14 21:52, Vicente J. Botet Escriba a écrit :
Le 11/01/14 19:40, Oliver Kowalke a écrit :
2014/1/11 Vicente J. Botet Escriba
Boost.Thread interruption feature adds some overhead to all the synchronization functions that are interruption_points. It is too late for Boost.Thread, but what do you think about having a simple fiber class and an interruptible::fiber class?
boost.fiber already support interruption (boost::fibers::fiber::interrupt()) - in contrast to boost.thread it is simply a flag in an atomic variable.
Do you mean that the cost of the managing interruptible threads is null? Don't forget that you need to manage with the waiting condition variables so that you can interrupt the fiber, which has some cost independently of whether you use an atomic or a mutex.
Ah, I forgot. You need to access the fiber specific storage of the fiber for each consdition_variable::wait operation, which is far from been an operation without cost.
The same argument you are using to support several schedulers should apply here, as it is evident to me that the interruption management has a performance cost.
Best, Vicente