Re: gnome-vfs usage of GConf vs threads - doh

On 10 Dec 2002, Michael Meeks wrote:

> > With CORBA reentrancy there are no way to set up rules such that if you 
> > follow them you avoid deadlocking when holding a lock over a CORBA call. 
> 	But then again; thread per call sounds horribly expensive resource
> wise; hmm. Quite possibly a magic queueing API would be better.

Yes. I'm not actually proposing using thread per call always. That would 
be way to expensive and complicated. :) It has its uses though, so it 
should be allowed.

> > How would you make it safe if we are working in a single-threaded 
> > environment where corba calls reenter (and you have no control of other 
> > corba calls, like when you're writing a library/component)?
> > 
> > The threaded case is surely complicated, but the re-entering one has no 
> > solution.
> 	Not at all - there is a trivial solution; copy the list and/or
> filter/update before you start doing your calls - clearly then (if
> you're unreffing) you own a list of references; if you're not reffing -
> you can at least hold a local CORBA_Object ref which involves no
> roundtrip, and you're safe.

Hmmm. I'm not sure here. I thought it was like this, but I may be 

If item is a BonoboObject you can't safely ref it, because 
bonobo_object_ref() is a reentrancy point as well. If bonobo_object_ref() 
could be made a pure local call that would increase the "local refcount" 
of the object reference it would work, but this is not possible due to the 
fact that CORBA doesn't track object reference passing.

Are you saying you can ref a CORBA object with a guarantee of no 

> > Something like that would be good. Of course, this can cause trouble if 
> > another thread uses that poa. I can hardly e.g. stop all processing for 
> > bonobo_poa_manager() from a gnome-vfs thread. So I have to have my own POA
> > instance to do that. 
> 	Sure - we'll have to expand the POA stuff in libbonobo anyway - and
> make it threadsafe (which should be fairly easy) since thread policies
> are per poa.

Yes. A lot of APIs (such as bonobo-activation and GConf) need to be 
extended so that you can pass in a POA to use.

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an otherworldly zombie barbarian on a mission from God. She's an artistic 
antique-collecting femme fatale from a different time and place. They fight 

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