10 Jan
2014
10 Jan
'14
7:52 p.m.
2014/1/10 Eugene Yakubovich
That's a good point. Since a fiber can only be in one waiting list at a time, an intrusive list node can be placed right into the fiber_base object. Alternatively, a node object can be allocated right on the stack. It won't get destructed as the fiber suspends itself right after putting itself into a wait queue (that's the way Linux kernel does it). The only thing is I'm not sure if boost::intrusive supports such usage.
I didn't noticed boost.intrusive until now - I think it could be possible to add the required intrusive interface to fiber_base (it already adds support for intrusive_ptr). I'll try to implement this stuff.