guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ethreads: event-driven cooperative threads


From: Ludovic Courtès
Subject: Re: ethreads: event-driven cooperative threads
Date: Mon, 02 Apr 2012 17:25:57 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux)

Hello!

Thanks for your work in this area!

Andy Wingo <address@hidden> 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’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]