2009/5/11 Axel Simon <axel.si...@ens.fr>:
> On Mon, 2009-05-11 at 16:09 +0100, Colin McQuillan wrote:
>
>> Valgrind needs "--smc-check=all". So my original patch wasn't causing the 
>> crash.
>>
>> Attached is my proposed patch. I've gone for C finalizers because it's
>> much simpler.
>
> I'm currently trying to automatically wrap every call above
> Cairo,Pango,Glib in gdk_threads_enter and gdk_threads_leave just like
> the guy doing the Java binding proposed. In particular, every finalizer
> will try to acquire the lock before it calls the actual finalizer in Gtk
> +. This will fix the concurrency problem that manifests itself in the
> Xlib protocol error.
>

This by itself would still leave a problem with finalizers: according
to the GDK threads page, all Win32 calls must be made in the main OS
thread. I believe java-gnome simply doesn't support Windows. Given the
Win32 restriction to one OS thread, there's no point using locking.

> If this works, then queueing finalizers won't strictly be necessary.
> However, it might be a good idea for performance: if the lock is taken
> when a finalizer is run, we simply call g_idle_add to run it and return
> to the GC immediately. So, I'll use your C functions to implement that.
>

It's also important for correctness! Running UI callbacks whenever GC
occurs is scary.

--
Colin McQuillan

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to