[Haskell-cafe] what GUI library should i select?
simonpj at microsoft.com
Tue Nov 14 05:40:40 EST 2006
I wonder whether it'd be possible to make the gtk2hs stuff emit warnings if you make calls from two different threads? Then an application would complain constructively rather than "becoming unstable".
| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of
| Dmitry V'yal
| Sent: 14 November 2006 10:27
| To: haskell-cafe at haskell.org
| Subject: Re: [Haskell-cafe] what GUI library should i select?
| Bulat Ziganshin wrote:
| > it is what i say about. threaded RTS + multipls threads that does
| > computations + one thread that interfaces with Gtk2Hs. afaiu, the only
| > problem is that i need to manage both Gtk events and periodically
| > check queue of commands from other threads, but using timer + Chan
| > should allow to implement this
| I wrote multi threaded gui application in Haskell last spring as a educational
| project. That was a tool for analyzing and extracting contents of FAT volumes.
| Then i started my project, i was completely unaware of these threading issues
| and freely called gtk2hs routines from several threads. All worked fine at
| first, but when i added some disk I/O to my threads, my program became unstable.
| While on linux it just crashed from time to time, on windows i saw more curious
| behavior. At random spots threads lost ability to call WinAPI functions.
| Basically they got an error code meaning something weird like "insufficient
| memory to complete call" in return. That was not easily reproducible and
| depended on exact version of Windows. At some point my app was fully functional
| on WinXP and didn't even start on Win2000.
| I spent a lot of time trying to debug these issues and finally refactored my
| program to make use of approach you describe. Worked fine after that. All you
| have to do is to choose appropriate timer interval, otherwise your app becomes
| too jerky or CPU hungry.
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
More information about the Haskell-Cafe