Thanks, I&#39;ll keep that in mind.<div><br></div><div>I wrote a better example of what I&#39;m trying to do: <a href="https://gist.github.com/1420742" target="_blank">https://gist.github.com/1420742</a> It runs worse with multiple threads than it does with one (both time-wise and memory-wise), I think due to the bug Simon described in that commit.</div>

<div><br></div><div>But that bug aside, is it possible to write a multithreaded application in Haskell that sends large amounts of data from one thread to the other without getting crushed by GC? I&#39;ve looked into the garbage collector a bit, and this seems problematic.</div>


<div><div><div><div>
<br></div><div>Mike S Craig<br><br><br><div class="gmail_quote">
On Thu, Dec 1, 2011 at 2:38 PM, Edward Z. Yang <span dir="ltr">&lt;<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




OK. A common mistake when using channels is forgetting to make sure<br>
all of the informaiton is fully evaluated in the worker thread, which then<br>
causes the writer thread to spend all its time evaluating thunks.<br>
<br>
Edward<br>
<br>
Excerpts from Michael Craig&#39;s message of Thu Dec 01 13:17:<a href="tel:57%20-0500%202011" value="+15705002011" target="_blank">57 -0500 2011</a>:<br>
<div><div>&gt; Excellent! Glad this has been sorted out upstream.<br>
&gt;<br>
&gt; Edward, to answer your question regarding blocking database calls: I&#39;m<br>
&gt; using mongoDB to log events that come into a WAI webapp. The writes to<br>
&gt; mongo are blocking, so I&#39;d like to run them in parallel with the webapp.<br>
&gt; The webapp would push the data into a Chan and the mongo writer would read<br>
&gt; from the Chan and make the writes sequentially (using the Chan as a FIFO<br>
&gt; between parallel threads). This would allow for request rates to<br>
&gt; temporarily rise above mongo&#39;s write rate (of course with an expanded<br>
&gt; memory footprint during those bursts).<br>
&gt;<br>
&gt; Mike S Craig<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Dec 1, 2011 at 12:10 PM, Felipe Almeida Lessa &lt;<br>
&gt; <a href="mailto:felipe.lessa@gmail.com" target="_blank">felipe.lessa@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Thu, Dec 1, 2011 at 2:40 PM, Edward Z. Yang &lt;<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>&gt; wrote:<br>
&gt; &gt; &gt; Simon Marlow investigated, and we got this patch out:<br>
&gt; &gt;<br>
&gt; &gt; Nice work, guys!  Hope it gets included in the glourious GHC 7.4 =D.<br>
&gt; &gt;<br>
&gt; &gt; Cheers,<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Felipe.<br>
&gt; &gt;<br>
</div></div></blockquote></div><br></div></div>
</div></div>