FFI: number of worker threads?

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Jun 21 14:23:24 EDT 2006


Hello Peng,

Wednesday, June 21, 2006, 8:31:41 PM, you wrote:

> My wish is to have a future GHC implementation that (a) uses blocking
> I/O directly provided by the OS, and (b) provides more control over OS
> threads and the internal worker thread pool.  Using blocking I/O will
> simplify the current design and allow the programmer to take advantage
> of high-performance OS threads. If non-blocking I/O is really needed,
> the programmer can use customized, Claessen-style threads wrapped in
> modular libraries---some of my preliminary tests show that
> Claessen-style threads can do a much better job to multiplex
> asynchronous I/O.

all I/O is done by the library procedures and so we can use other
implementations (other libraries) without waiting for GHC changes (and
GHC imho will be changed to include some sort of such library instead
of adding new features to current already very complex I/O implementation)

one of such libs is Einar's network-alt library that uses
select/epoll/kqueue to overlap network i/o

another library is my own Streams library that implements all the
layers of I/O functionality and need only to implement read()/write()
behavior in some way. currently is uses direct read()/write()
calls but if someone will make alternative fdGetBuf/fdPutBuf
implementations, it will work with it

read: http://haskell.org/haskellwiki/Library/Streams
Download: http://www.haskell.org/library/Streams.tar.gz
Installation: run "make install"

ps: new version of library is coming soon, but in this particular
area nothing was changed

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Glasgow-haskell-users mailing list