Re: Does gtk have issues with STL?



I had already figured out that widgets had to be created in the main thread, or else the event loop wouldn't handle them. I did not realize that one had to be careful with updating widgets as well! That explains a few things.

So gdk_threads_enter() should be called around data updates. But is that called automatically in default signal handlers, or do I need to put it there myself as well? It feels odd locking only one thread explicitly.

Also, may I assume that calls made in the thread containing the event loop don't need this protection?

----- Original Message -----
From: Paul Davis <paul linuxaudiosystems com>
Date: Monday, February 11, 2008 4:49 pm
Subject: Re: Does gtk have issues with STL?

> 
> On Mon, 2008-02-11 at 15:45 -0500, Lindley M French wrote:
> 
> > I suspect these are merely symptoms of some other corruption, 
> but I can't seem to find it.
> 
> with a 99.872% confidence level, i can confirm your belief.
> 
> > I'm using pthreads with this; nothing complex, and I think I 
> have everything mutex'd, but it did make me wonder: Does GTK use 
> gthreads internally, and is there any issue with using gthreads 
> and pthreads at the same time?
> 
> if you don't understand the answer to this already, it suggests 
> that it
> may be unwise for you to be using threads at all.
> 
> the use of threads in GUI toolkits that originated in the X Window 
> worldis generally quite difference than the use of it with GUI 
> toolkits that
> originated in the win32 world. in particular, the general rule in GTK
> is:
> 
>  EITHER make GTK/GDK/X11 calls from a single thread only OR
>  use GDK_THREADS_{ENTER,LEAVE} around every (group of) GTK/GDK/X11
>  call(s).
> 
> googling will turn up plenty of refs to this stuff.
> 
> 
> > Also: Is it bad to emit a signal while in a signal handler 
> callback? In this case I'd like to make sure a scrollbar value-
> update takes place every time a bounds-update does.
> 
> in general, its not a problem. there are some specific instances where
> it can be an issue.
> 
> 
> 
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]