9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] rsc's libtask on embedded
Date: Thu,  9 Jul 2015 08:51:31 -0700	[thread overview]
Message-ID: <79C9DFA9-1814-477D-B2C2-CADE5B2D44B2@bitblocks.com> (raw)
In-Reply-To: <ad87a61821786e8658266cbbb35684da@quintile.net>

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 <steve@quintile.net> 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
> 



  parent reply	other threads:[~2015-07-09 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09  8:38 Steve Simon
2015-07-09 14:17 ` Joseph Stewart
2015-07-09 14:50   ` Steve Simon
2015-07-09 15:09     ` David du Colombier
2015-07-09 15:52       ` Joseph Stewart
2015-07-09 15:55       ` Joseph Stewart
2015-07-09 15:51     ` Bakul Shah [this message]
2015-07-09 15:58     ` Joseph Stewart
2015-07-09 16:12       ` steve
2015-07-09 16:31         ` Bakul Shah
2015-07-09 16:50           ` Skip Tavakkolian
2015-07-10  2:07           ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=79C9DFA9-1814-477D-B2C2-CADE5B2D44B2@bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).