Re: glibmm thread safety



On Monday 15 January 2007 01:32, Daniel Elstner wrote:
> Am Montag, den 15.01.2007, 00:57 +0000 schrieb Chris Vine:
[snip]
> > This works provided that the notifying objects are only constructed and
> > destroyed in the main loop thread.  Unlike Glib::Dispatcher, my
> > implementation does not have this restriction but it is documented that
> > further synchronisation may be required IF they are constructed or
> > destroyed in other threads and object lifetime cannot be guaranteed.
>
> Well, you can have multiple main loops.  I believe one of the glibmm
> threading examples actually does this.

If I come across a need for that, I was going to templatise the notifier class 
with a tag type for each main context/main loop so that there would be a 
separate pipe for each main context.  It could still be useful though to be 
able to create the notifier object in a different thread from the one in 
which the slot will execute.

Chris




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