[Haskell-cafe] System calls and Haskell threads

David Barbour dmbarbour at gmail.com
Thu Nov 3 18:22:20 CET 2011


On Thu, Nov 3, 2011 at 8:35 AM, Andreas Voellmy
<andreas.voellmy at gmail.com>wrote:

> I just read Kazu Yamamoto's article on a high performance web server in
> the latest Monad.Reader, and I came across a statement that doesn't sound
> correct to me. He says:
>
> "When a user thread issues a system call, a context switch occurs. This
> means that all Haskell user threads stop, and instead the kernel is given
> the CPU time. "
>
> Is this right?
>

It is correct in context. Mighttpd does not use the -Nx argument to create
multiple OS threads, instead uses a `prefork` model that creates separate
processes to balance user invocations. Using multiple processes instead of
multiple Haskell threads avoids issues with garbage collection.

Regards,

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111103/e78a2a39/attachment.htm>


More information about the Haskell-Cafe mailing list