develooper Front page | perl.perl5.porters | Postings from February 2000

Re: [PATCH 5.5.660] ExtUtils::DynaLoader dl_unload_file() patch

Gurusamy Sarathy
February 29, 2000 14:47
Re: [PATCH 5.5.660] ExtUtils::DynaLoader dl_unload_file() patch
Message ID:
On Tue, 29 Feb 2000 21:46:08 GMT, Alan Burlison wrote:
>Ilya Zakharevich wrote:
>> > 3.  Modified dl_generic_private_init() in dlutils.c to install
>> > Perl_call_atexit() handler that calls dl_unload_all_files() when the
>> > interpreter exits.
>> What happens with multiple interpreters in presence?
>Oops!  Forgot about that question - pass.  What happens anyway with
>multiple interpreters?

The exitlist functions will be called for every interpreter that
shuts down via perl_destroy().  As long as the loader refcounts the
dlopen()s and dlclose()s properly, I think we're ok.

>Does dl_load_file() get called once per use/require'd .xs file per
>interpreter instance?  Does it push multiple copies of the dll handles
>onto dl_librefs?  dl_unload_files simply do in reverse whatever
>dl_load_files did.

Dups are normally avoided because modules only ever gets use-d once,
but if somebody reloads a module, you could end up with dups.  But
that should be ok, since every duplicate means an additional dlopen()
on the file, so the number of dlclose()s will match.

Sarathy Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About