[Haskell] select(2) or poll(2)-like function?

Piyush P Kurur ppk at cse.iitk.ac.in
Mon Apr 18 08:01:08 CEST 2011


On Mon, Apr 18, 2011 at 12:47:33AM +0200, Johan Tibell wrote:
> In other words, it's reasonable to fork of tens of thousands of threads and
> expect good performance.

	Yes I think. Besides from the point of view of programming servers
like for e.g. a web server, the forkIO based solution is more natural.

<begin rant>
It is unfortunate that the usual fork and even pthread_create is not light
weight enough for programming such high performance servers. The select 
based programming is more a hack than anything IMNSHO.
<end rant>

The light-weight threads of GHC hence is a boon besides other goodies like
STM, Channels etc.

Disclaimer: I have never programmed large servers on GHC nor benchmarked
any servers that are available. But I believe stuff like Wai server (used
by yesod) etc uses forkIO and has very good performance.

Regards

ppk



More information about the Haskell mailing list