Re: Request of API which are thread safe/unsafe

On Wed, 2012-04-04 at 09:50 +0200, Pavel Holejsovsky wrote:
> On 4/4/2012 5:30 AM, Colin Walters wrote:
> > Another idea is to add the concept of "only run dispose/finalize in
> > this main context" to GObject.  Possibly objects could record
> > the main context in which they were constructed, and GObject would
> > do the marshaling automatically.  G_TYPE_FLAG_MATCH_DISPOSE_CONTEXT ?
> It would be nice if this flag name would be a bit more generic - 
> G_TYPE_FLAG_MATCH_CONTEXT only; bindings then could arrange marshaling 
> *any* call of such object into the appropriate context.  This could help 
> to overcome possible bindings' problems with planned deprecations of 
> GTK+ threads API.

Mmm...marshaling any call like that would require modifying every single
entry point of every single widget; I really doubt it's worth the
complexity and speed hit.  Second, it would give them asynchronous
semantics, which would very likely break nontrivial programs anyways.
Consider an application which was adding data to a list view from a
thread; the data wouldn't be there until the main loop ran.

The deprecation of the GDK threads API isn't itself a binding issue; it
affects C programs too.  So I don't think it makes sense to directly
conflate them.

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