[sldev] I found a possible problem on linux (gdk/gtk related)
Carlo Wood
carlo at alinoe.com
Thu Jun 18 09:33:13 PDT 2009
On Thu, Jun 18, 2009 at 11:16:02AM -0500, Mike Dickson wrote:
> As long as all the drawing is done on the main thread there's no reason
> to initialize the toolkit for threading. I've never had any real
> positive experience with GTK and threading. Especially since many of
> the libraries you might use are likely not thread safe. Certainly can
> use threads for computation but if you make proper use of the eventing
> system and use idle_add to push gtk stuff onto the main thread.
>
> Yes, I know gtk and thread can supposedly be done. I've just never had
> much luck with it personally. The above patterns work much better for
> me.
The main reason I want to do this is because currently every call
to gtk_main() (ie, every gtk window; like file upload / download
file pickers) *completely* freeze the (mainloop of the) viewer.
If you don't pick a file right away, you time out!
After my changes, you can just open a file picker window, and move
it around, not resulting anymore in a black screen. Everything
continues to work perfectly. This is how it should be; not stupid
time outs.
I solve the deadlock in the meantime anyway... I needed it to be
fixed myself, it was annoying. But there is no high priority to
make a patch for snowglobe until I'd include a patch to make the
filepickers non-blocking, as it turns out not to be a dead lock
due to multiple threads using gtk, but it was a recursive call
because I had been too laze to wrap all gtk_main()'s in 'enter'/'leave'
functions.
--
Carlo Wood <carlo at alinoe.com>
More information about the SLDev
mailing list