Re: GModule unloading



On Wed, 2007-05-23 at 10:32 -0500, Matt Hoosier wrote:
> On 5/23/07, Michael Ekstrand <mekstran scl ameslab gov> wrote:
> > On Wed, 2007-05-23 at 10:18 -0500, Matt Hoosier wrote:	
> > > Often these things will link against shared libraries which the main
> > > shell application itself doesn't. So I'm concerned about whether the
> > > main UI is going to crash when some GType registered during the
> > > lifetime of a module, is made invalid.
> >
> > Yeah, it'll crash as soon as anything tries to access the type info.
> >
> > Idea: can you fork(), and then load the module in a separate process?
> > The load vs. exec will prevent the load cost of GTK+, but the fork will
> > let you have each app in its own address space.  Closing can be
> > terminating the process rather than unloading a module, so you don't
> > have to worry about any of this.
> 
> Thanks for the info about the unloading behavior, Michael.
> 
> Isn't that going to cause all kinds of confusion when the child
> process is trying to re-use the same socket FD to talk to the X server
> and such?

Err, yeah, forgot about that.  Yup, things will get royally confused.

> I don't have a big objection to marking every module as permanently
> resident. I just needed to know whether that was a technical
> requirement or not.

Yeah it is, unless you do have a way to know or ensure that the loaded
module will stay resident (I don't know that it will unload, but if it
does, the data will be invalid, and things will crash).
 
- Michael




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