[Haskell-cafe] Re: Climbing up the shootout...

Simon Marlow simonmarhaskell at gmail.com
Fri Sep 26 12:01:12 EDT 2008


Manlio Perillo wrote:
> Simon Marlow ha scritto:
>> Manlio Perillo wrote:
>> [...]
>> We'd certainly support any efforts to add support for a more modern 
>> I/O multiplexing or asynchronous I/O back-end to the IO library.  It's 
>> not too difficult, because the interface between the low-level I/O 
>> supplier and the rest of the IO library is rather small - just a few 
>> functions that read and write blocks of data in a blocking or 
>> non-blocking way. The blocking variants currently communicate with the 
>> I/O manager thread which does select() on behalf of the clients.
>>
> 
> There is some documentation that summarize the current status, and how 
> all fits together?

Sadly no, but the code is mostly restricted to a couple of modules 
(GHC.Handle and GHC.Conc).

> There are some benchmarks that tell you the use of a separate I/O 
> manager thread is a good solution?

Compared to what?  I did measure the difference between doing this in 
Haskell code in the IO library (as with -threaded) against doing it in 
the RTS (without -threaded), and the Haskell version won hands down, 
mainly because it only re-initiates the select() when it has to change 
the file handles in the set.  Using epoll() instead of select() should 
be even better.

Cheers,
	Simon



More information about the Haskell-Cafe mailing list