Simon,

I'll look into the callback of the treeview_ function! Thanks for the
stacktrace.

On Tue, 2009-11-10 at 14:14 +0000, Simon Marlow wrote:
> > Yes, for the GUI part of Gtk2Hs, this is the only way to go. I think
> > what I would like is a hook in the RTS of ghc that allows me to run
> a C
> > function each time the GC has finished. This C function can be run
> from
> > any OS thread. I would make this function call g_idle_add (which is
> > thread-safe) to add a function that empties the list of finalizers
> that
> > I've accumulated during GC. If the main Gtk+ loop is currently
> running
> > or will run at some point in the future, the finalizers form the
> list
> > will be executed. If the Gtk+ is never run again then I probably
> don't
> > care anyway that the finalizers are not run since the program is
> stuck
> > or about to end.
> 
> Could you not do this without a hook, by adding a call to g_idle_add
> to 
> each finalizer?  Perhaps with some intelligence so you don't add 
> multiple g_idle_adds if one is already pending.
> 
> Calling it once per GC might be too much: there are lots of GCs.
> 

Well, I admit, I didn't realize that the C function hook would only add
the finalizers to the main Gtk+ loop rather than running them. So I
guess, yes, I could implement the above and get the same effect.

I'll ponder a bit more about this and see if there is a case where this
doesn't work. I agree that it would be nice to get the -threaded flag
working for future Gtk2Hs versions and for older GHCs.

Cheers,
Axel.



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to