Is it possible to combine Intel TBB and fibres (lightweight, cooperatively scheduler threads) that use e.g., ucontext.h (getcontext, setcontext and swapcontext) ?
My situation: a running task A makes a call that is unable to return immediately. So I use the same thread to process further tasks, for example task B that also makes the same call as task A. Yet another task (task C) gets started. At that point, the call made by A gets to a state where it could continue, but not the call made by B. But since the situation on the stack is "A,B,C", I cannot let A continue until B and C finish.
If I put A, B and C into separate fibres, I could start A on a different thread or at least start A right after C finishes, bypassing B. However, I suspect something will go horribly wrong inside the TBB task scheduler if I do it like this. Has anyone tested a thing like this before? Or can someone tell even without trying that it will indeed all explode?