unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: ice-9 async-queue
Date: Wed, 08 Feb 2012 14:44:16 +0100	[thread overview]
Message-ID: <87ipjhcudr.fsf@inria.fr> (raw)
In-Reply-To: 87ehu7f2xa.fsf@pobox.com

Hi!

Andy Wingo <wingo@pobox.com> skribis:

> The web server is single-threaded and uses blocking IO (though it does
> poll(2) for keepalive).  As such, any slow writer or slow reader can
> block the process.  Using non-blocking I/O is too difficult, for now.
> So, threads.
>
> I'd like to create a pool of threads for I/O.  Some threads would pop
> ports off of the "to-read" queue, read request headers and bodies, then
> push the requests onto a "to-process" queue.  Something (currently the
> main thread) would process requests, and push them onto the "to-write"
> queue.  IO threads would pop data (or closures) off of the to-write
> queue, and write them to clients, possibly pushing the ports back on a
> "to-keepalive" queue, which the poll loop would notice and add those fds
> back to the poll set.

OK, I see.

> I'd also like to consider creating a separate pool of threads for
> computation.  Obviously the size of these thread pools would be
> different.  We could use futures for that, I suppose, but I'd like to
> also be able to stop those threads, forcefully if needed, when the web
> server stops.

What do you think of adding a ‘cancel’ primitive to futures?

Thanks,
Ludo’.



  reply	other threads:[~2012-02-08 13:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 17:00 ice-9 async-queue Andy Wingo
2012-02-06 22:09 ` Mike Gran
2012-02-07  8:34   ` Andy Wingo
2012-02-07  8:36   ` Andy Wingo
2012-02-06 22:57 ` Ludovic Courtès
2012-02-07  8:44   ` Andy Wingo
2012-02-08 13:44     ` Ludovic Courtès [this message]
2012-03-03 17:53       ` Andy Wingo
2012-03-07 21:11         ` Ludovic Courtès
2012-02-07 10:02 ` Daniel Hartwig
2012-02-07 21:46   ` Andy Wingo
2012-02-08  8:36     ` Daniel Hartwig

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=87ipjhcudr.fsf@inria.fr \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).