<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">From: Donn Cave &lt;<a href="mailto:donn@avvanta.com">donn@avvanta.com</a>&gt;<br><br>
[I wrote initially, ...]<br>
<br>
&gt; As I have migrated more of my application into Haskell, I find that<br>
&gt; I/O in one thread effectively blocks other threads.<br>
<br>
Resolved - the SSL_read external I/O function needs to be &quot;safe&quot;.</blockquote><div><br></div><div>If anyone is listening, I would very much like for there to be a mechanism by which external functions can be called &quot;unsafe&quot;-ly, but without blocking all other Haskell threads. I have code that does this:</div>
<div><br></div><div>calcUpdate a b c = do</div><div> expensiveComputation a b</div><div> expensiveComputation a c</div><div><br></div><div>&quot;expensiveComputation&quot; mutates the second argument (b or c here), but does not call back into Haskell or update &quot;a&quot; and I would very much like to run these two in parallel, however it&#39;s not possible if &quot;expensiveComputation&quot; is unsafe.</div>
<div><br></div><div>If I make &quot;expensiveComputation&quot; safe, the extra time necessary for safe-ness outweighs the gains from parallelization for even reasonably-sized inputs (the expensiveComputation is called 100k&#39;s of times or more). My current plan is to handle the parallelization in C, but I&#39;d prefer to do it in Haskell if possible.</div>
<div><br></div><div>John</div></div>