
On Wed, 2004-05-05 at 14:55, Simon Peyton-Jones wrote:
| I'm thinking about how to make threaded Haskell program work nicely with Gtk+ (the widget toolkit) and whether the new threaded rts will help or not. | Would bound threads help? I'm not sure I understand the idea very well.
That's *exactly* what the bound-threads idea is for. It's implemented in GHC 6.2.1 (see the bound-thread operations in Control.Concurrent). There is a more detailed writeup about bound threads that I think we neglected to complete and publish. Wolfgang Thaller is the main author, and I hope he may pick this up. Meanwhile we'll put the current draft on the GHC site.
So here's what I don't understand: we make a non-blocking call to gtk+'s main loop (which makes a blocking call in a new OS thread). So we get callbacks from gtk in this other thread, which is fine. However if we launch any other Haskell threads that want to update the GUI in any way they need to make calls in the GUI OS thread. But the GUI OS thread is not in Haskell land at this point, it's blocked in a call to the gtk+ main loop. Duncan