Subject: [boost] [fiber] destruction order fiasco
From: Tatsuyuki Ishi (ishitatsuyuki_at_[hidden])
Date: 2016-11-15 06:25:21
The fiber still makes use of the scheduling algorithm after main context
exits, which is a problem for my case that puts a stack-allocated shared
data to the algorithm.
https://github.com/boostorg/fiber/blob/master/src/context.cpp#L52 I doubt
if the schwarz counter is needed; isn't it only one?
don't think there's a need to wake it up; if it's sleeping, the thread is
blocked and it never enters here. This is the main problem: use-after-free.
Anyway, what I think is ideal is that just making the algorithm a reference
and assign it from the main context. An example of this approach is Qt's
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk