Re: gnome-vfs usage of GConf vs threads



On Mon, 9 Dec 2002, Havoc Pennington wrote:

> On Mon, Dec 09, 2002 at 10:50:51AM -0500, Alexander Larsson wrote:
> > 
> > I don't understand what you mean. Do you mean adding stuff to the glib 
> > mainloop that sets the variable? I'm not sure a vfs module can rely on the 
> > glib mainloop being availible like that. Non-mainloop based apps may use 
> > gnome-vfs.
> 
> But ORBit and thus gconf depends on the mainloop, at least I thought
> so.
> 
> I don't mean adding an extra mainloop handler, just using what gconf
> already has. All I'm saying really is "why not move all the gconf
> stuff into the main thread," surely there's _some_ way to do that...

Not really...

A gnome-vfs module can work in two different contexts:

For a sync call it's just a direct call from the app to the module 
implementation. This is normally on the main thread, but could be done 
from a thread too, if the app is threaded.

For an async call the module implementation gets called on one of the 
gnome-vfs worker threads, in parallel with the other gnome-vfs threads and 
the app threads.

In neither of these cases do we have any control of the applications use 
of the glib mainloop or ORBit. An app using sync calls may be e.g. 
vfs-shell that is a typical command line app and has no mainloop. In the 
async case we can't use corba calls, because we have no control of the 
main threads use of corba.

I think the only solution is have the main gnome-vfs library do config 
reading in the initialization code, and then set up notifier checks in the 
mainloop that propagate changes to variables under a lock. This means 
config changes would only be visible if the app uses the glib main loop, 
but I think that is ok.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a lonely playboy master criminal on his last day in the job. She's a 
bloodthirsty paranoid pearl diver fleeing from a Satanic cult. They fight 
crime! 





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