<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 19, 2013 at 12:13 PM, Thiago Padilha <span dir="ltr"><<a href="mailto:tpadilha84@gmail.com" target="_blank">tpadilha84@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1gy" style="overflow:hidden">I still dont understand why ghci is not using the default thread to<br>
run the binding, but from now on I will be more alert when binding to<br>
libraries that uses threads.<br></div></blockquote><div><br></div><div>-fno-default-sandbox ? (this changes in upcoming ghci, I believe)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1gy" style="overflow:hidden">
Theres something else I also dont understood about FFI: When trying to<br>
debug the problem I've written many printf statements  but none of<br>
them showed on the screen, but now that the example is working I've<br>
notice that all printed text appears once I exit ghci. Why is that<br>
happening?</div></blockquote><div><br></div><div>Because C/C++ stdio buffers by default, as does Haskell's --- but they are independent buffers, so the state of the Haskell buffering mode is not relevant to C/C++ or vice versa and flushing in one does not affect the other. Evidently the C one is only getting flushed in an atexit() hook. (You may want to look at setvbuf().)</div>
<div><br></div></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>
<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>