search for: fiber_suspend

Displaying 3 results from an estimated 3 matches for "fiber_suspend".

2016 Jun 13
3
[RFC] LLVM Coroutines
...s build a fiber abstraction out of make_context, jump_context. i1 fiber_fork(i8* %mem) - clones this function into a fiber returns 0 - in a fiber returns 1 - in a thread uses %mem to store fiber context + fiber stack i1 fiber_suspend() - suspends current fiber, switches back to thread stores the fiber context to be able to resume later void fiber_join(i8* %mem i1 %val) - switches to fiber stack identified by %mem, fiber_suspend will return %val when resumed void fiber_e...
2016 Jun 15
2
[RFC] LLVM Coroutines
...t can "return twice"? If so, I'd urge you to try to > not rely on that kind of behavior. LLVM has unresolved issues around > modeling setjmp like behavior, and if possible, it is preferable to > make all of the control flow explicit from the very beginning. > >> i1 fiber_suspend() - suspends current fiber, switches back to thread >> stores the fiber context to be able to resume later > > This looks like a normal function call, except that the "return" may > be arbitrarily spaced out from the call? > >> void f...
2016 Jun 12
2
[RFC] LLVM Coroutines
I think I got it. Original model (with coro.fork and two-way coro.suspend) will work with a tiny tweak. In the original model, I was replacing coro.suspend with br %return in original function. The problem was coming from potential phi-nodes introduces into return block during optimizations. Let's make sure that there is only entry into the return block. In the original model, ReturnBB had