[Haskell-cafe] gtk2hs and runghc

Günther Schmidt gue.schmidt at web.de
Wed Sep 23 14:24:26 EDT 2009

Am 23.09.2009, 19:29 Uhr, schrieb Duncan Coutts  
<duncan.coutts at worc.ox.ac.uk>:

> On Tue, 2009-09-22 at 17:08 -0400, Brandon S. Allbery KF8NH wrote:
>> Hash: SHA1
>> On Sep 22, 2009, at 11:31 , Günther Schmidt wrote:
>> > Gtk2hs then complains about running in a multithreaded ghc, ie. one
>> > with several "real" OS threads. Is it possible to start runghc
>> > single-threaded?
>> No, but you can unsafeInitGUIForThreadedRTS.
> If you observe the foot-shooting restrictions (of which the easiest is
> to not use forkIO).
> Duncan

And exactly herein lies the problem :)

I've seen your response to the recent post about gui state, in which you  
mention your own prefered solution to the problem, ie. that you "post"  
your state to a channel which is read in a thread.

I'm doing the same thing, but I'm also "calling" gui code from within that  
thread. I figured since the thread itself isn't a separate OS thread it  
shouldn't be a problem.

It seems to work once the app is compiled, but running the code in either  
ghci or with runghc it crashes.


More information about the Haskell-Cafe mailing list