[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ice-9 async-queue
From: |
Ludovic Courtès |
Subject: |
Re: ice-9 async-queue |
Date: |
Wed, 08 Feb 2012 14:44:16 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) |
Hi!
Andy Wingo <address@hidden> 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’.