Duncan Coutts wrote:
On Wed, 2007-04-04 at 00:01 +0100, Frederik Eaton wrote:
Hello,

This is a bit lame but I don't know where to find the information...

I am wondering if ghci is OK to use with threads now. It seems to work
but I have written down in some of my source code that a certain
function won't work under ghci because it uses threads and I can't
remember what the symptom of the problem was.

Some Haskell libs that bind to foreign thread-unsafe libraries cannot
safely be used with multiple Haskell threads in the threaded runtime
system (and of course ghhci uses the threaded rts these days).

In particular GUI libs are affected by this. For example you can use
Gtk2Hs in GHCi, but if you forkIO and call GUI stuff from multiple
threads... boom (or more likely an xlib error or segfault). There's info
on the Gtk2Hs site about how to do it safely.

Also, there are some library functions that will block all Haskell threads unless used with the threaded RTS (e.g. System.Process.waitForProcess). These are now safe to use with GHCi.

Cheers,
        Simon


_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to