<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.19">
<TITLE>Re: haskell httpd</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>G'day all.</FONT>
</P>

<P><FONT SIZE=2>Quoting Paul Graunke &lt;ptg@ccs.neu.edu&gt;:</FONT>
</P>

<P><FONT SIZE=2>&gt; Right, cooperative multitasking is faster than preemptive multitasking.</FONT>
</P>

<P><FONT SIZE=2>That's often the case, but it depends.&nbsp; Some OSes have very, very fast</FONT>
<BR><FONT SIZE=2>thread primitives.&nbsp; It also depends on the application, as I noted,</FONT>
<BR><FONT SIZE=2>because what you lose in system call overhead you can win back elsewhere.</FONT>
</P>

<P><FONT SIZE=2>&gt; One technique is to have several OS threads to make use of CPUs and</FONT>
<BR><FONT SIZE=2>&gt; do your own scheduling inside that.</FONT>
</P>

<P><FONT SIZE=2>That certainly works.&nbsp; The &quot;thread pool&quot; approach is the simplest</FONT>
<BR><FONT SIZE=2>incarnation of this.</FONT>
</P>

<P><FONT SIZE=2>&gt; Is there a problem with having a system thread do the IO based on</FONT>
<BR><FONT SIZE=2>&gt; pulling events from a channel and pushing the results back to a</FONT>
<BR><FONT SIZE=2>&gt; channel?&nbsp; You can push the result channel/mvar through the request</FONT>
<BR><FONT SIZE=2>&gt; channel along with the request.</FONT>
</P>

<P><FONT SIZE=2>Unfortunately, I can't think of a way to make this work with memory</FONT>
<BR><FONT SIZE=2>mapped files, which are pretty important these days.</FONT>
</P>

<P><FONT SIZE=2>Cheers,</FONT>
<BR><FONT SIZE=2>Andrew Bromage</FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Haskell mailing list</FONT>
<BR><FONT SIZE=2>Haskell@haskell.org</FONT>
<BR><FONT SIZE=2><A HREF="http://www.haskell.org/mailman/listinfo/haskell" TARGET="_blank">http://www.haskell.org/mailman/listinfo/haskell</A></FONT>
</P>

</BODY>
</HTML>