[Haskell-cafe] GUI Program Hangs in GHCI

Jason Dagit dagitj at gmail.com
Mon Jul 4 07:22:09 CEST 2011


On Sun, Jul 3, 2011 at 9:06 PM, Jason Dagit <dagitj at gmail.com> wrote:
> On Sun, Jul 3, 2011 at 8:31 PM, Alexander Solla <alex.solla at gmail.com> wrote:
>>
>>
>> On Sun, Jul 3, 2011 at 5:16 PM, Jason Dagit <dagitj at gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> I have a GUI program that when I compile it and run it there are no
>>> problems.  When I load it into GHCI and type, "main", it loads the
>>> main window but there are no window decorations and the program hangs
>>> to the point where I have to kill the ghci process.  You see a
>>> spinning cursor when you mouse over the window.
>>
>> I don't know if this is the same issue, but it sounds like it at first
>> glance:
>> http://www.haskell.org/pipermail/haskell-cafe/2011-May/092029.html
>
> Heh.  Yes, good memory!  That's a link to an email I wrote in response
> to Conal.  I'm looking into the issues that Conal mentions there.
>
> So far I've discovered that there is a bug in the Objective-C part of
> glfw when it inits threads[1].  Fixing that bug makes it so that I can
> use forkIO in the compiled version of my program but I still have the
> bad behavior in ghci.  I think the remaining bit is that OSX (and
> probably windows too) makes it very hard to run your event loop on a
> thread other than your original thread[2].  I'm now wondering if the
> threading model in GHC even gives me enough control to handle this
> situation correctly.

My test was incorrect.  Even with that fix I still can't use the
threaded RTS in the compiled version.  I think I understand the issue
now and I'm looking for a solution in a different thread (pun
intended?).

Jason



More information about the Haskell-Cafe mailing list