Sounds like all you want are coroutines (with create, destroy & switch-to 
calls) and wait queues (with create, destroy, signal & wait calls). With these 
you can build channels easily. With a bit more work you can even implement 
pre-emption but then you need mutexes. Setjmp/longjmp is fine (that was I did 
in my first version ages ago!).

> On Jul 9, 2015, at 7:50 AM, Steve Simon <> wrote:
> The system I am trying to add libtask to has no runtime other than libc.
> Corrently it is an even based system that uses a "min main loop" and
> a twisty maze of nested state machines that all look the same.
> Hence my desire to add co-routines + channels (i.e. exactly what libtask is)
> to it. I have no need for the file or network modules but those are easily 
> removed.
> I don't have the context calls but I do have setjmp/longjmp so that is what I
> am trying to use.
> I will shout if it works out.
> -Steve

Reply via email to