[Mono-devel-list] Proposal: Library Loading

Miguel de Icaza miguel at ximian.com
Wed Apr 14 11:24:00 EDT 2004


Hello,

> > For example, Gtk# would install something like this:
> > 
> > <configuration>
> > 	<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0.200.3" />
> > </configuration>
> > 
> > Notice that the full version for the .so file is specified on the
> > .libmap file.
> 
> And this is the problem: the full version is specified.  If no further
> intelligence is present, then I won't be able to use Gtk# anymore, as I
> have libglib-2.0.so.0.200.2 installed.  Since the version numbers don't
> match exactly (and mine has a lower patch number), dlopen(3) won't be
> able to find the library, so I won't be able to run my programs anymore.

Paolo addressed this question on a separate post.

> > Now, to install the libmap file a program must be invoked, this program
> > is responsible for copying the .libmap file into the $syconfdir
> > directory, and generate a fresh $sysconfdir/mono/config
> > 
> > So something like to install:
> > 
> > 	mlibconf -i gtk-sharp.libmap
> > 
> > And to remove:
> > 
> > 	mlibconf -e gtk-sharp.libmap
> 
> I forget who originally mentioned it, but I don't think the distributors
> will like the requirement to run a tool during the postinstall step. 
> Then again, it needs to be done for the GAC anyway, so maybe this isn't
> so bad.

They have to do this to maintain other files as well, like
"install-info" on Debian.

> Pardon my ignorance, but is the config file *really* needed at program
> startup?  I thought it was only needed when DllImport statements were
> used.
> 
> If that's the case (and I hope it is), then it would only impact the
> startup time of programs that used DllImport, not all programs (just
> many of them ;-), and the config directory could be lazy initialized on
> the first load of a native library.

Paolo also pointed out loading 50 XML files consumes memory, warm cache,
etc.




More information about the Mono-devel-list mailing list