Re: ghci question
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 Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: ghci question
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. Yay! I think that's what I wanted to know. Thanks, Frederik -- http://ofb.net/~frederik/ ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
ghci question
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. Many thanks, Frederik -- http://ofb.net/~frederik/ ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: ghci question
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. Duncan ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs