Thanks, I'll keep that in mind.<div><br></div><div>I wrote a better example of what I'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'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"><<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>></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'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>> Excellent! Glad this has been sorted out upstream.<br>
><br>
> Edward, to answer your question regarding blocking database calls: I'm<br>
> using mongoDB to log events that come into a WAI webapp. The writes to<br>
> mongo are blocking, so I'd like to run them in parallel with the webapp.<br>
> The webapp would push the data into a Chan and the mongo writer would read<br>
> from the Chan and make the writes sequentially (using the Chan as a FIFO<br>
> between parallel threads). This would allow for request rates to<br>
> temporarily rise above mongo's write rate (of course with an expanded<br>
> memory footprint during those bursts).<br>
><br>
> Mike S Craig<br>
><br>
><br>
> On Thu, Dec 1, 2011 at 12:10 PM, Felipe Almeida Lessa <<br>
> <a href="mailto:felipe.lessa@gmail.com" target="_blank">felipe.lessa@gmail.com</a>> wrote:<br>
><br>
> > On Thu, Dec 1, 2011 at 2:40 PM, Edward Z. Yang <<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>> wrote:<br>
> > > Simon Marlow investigated, and we got this patch out:<br>
> ><br>
> > Nice work, guys! Hope it gets included in the glourious GHC 7.4 =D.<br>
> ><br>
> > Cheers,<br>
> ><br>
> > --<br>
> > Felipe.<br>
> ><br>
</div></div></blockquote></div><br></div></div>
</div></div>