unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: ethreads: event-driven cooperative threads
Date: Mon, 02 Apr 2012 17:25:57 +0200	[thread overview]
Message-ID: <87iphijgu2.fsf@inria.fr> (raw)
In-Reply-To: 87wr6cmx63.fsf@pobox.com

Hello!

Thanks for your work in this area!

Andy Wingo <wingo@pobox.com> skribis:

> I pushed an experimental branch recently, wip-ethreads.  It implements
> user-space cooperative threads that yield when they would otherwise
> block or sleep.  It seems to be useful for servers.

Interestingly, user-level threads + port wrappers is the same strategy
as GNU Pth.

It has the advantage of avoiding IoC, while nicely solving some of the
problems associated with native threads (state mutations are atomic,
‘fork’ can be used, etc.), but it has shortcomings.

First, if user code ends up using a “raw” port, or does some other
blocking call (even indirectly, via a library), the whole program is
blocked.

Second, if at some point you want to start using more than one core,
you end up building an N×M thread library, which is a nightmare [0, 1].

  [0] http://www.akkadia.org/drepper/glibcthreads.html
  [1] http://www.akkadia.org/drepper/nptl-design.pdf


So, it seems cool to me, and it’s great that it addresses the
web-server-that-forks use case.  However, I fear that it’s not
sufficiently generalizable.

WDYT?

Thanks,
Ludo’.




  parent reply	other threads:[~2012-04-02 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 16:13 ethreads: event-driven cooperative threads Andy Wingo
2012-03-23  2:00 ` Nala Ginrut
2012-03-23  9:25   ` Andy Wingo
2012-04-02 15:25 ` Ludovic Courtès [this message]
2013-01-17  9:58   ` Andy Wingo

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=87iphijgu2.fsf@inria.fr \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).