[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 20000118.004] DynaLoader doesn't dlclose XS code on interpreter



On Wed, Jan 19, 2000 at 02:38:18PM -0500, Ilya Zakharevich wrote:
> Alan Burlison writes:
> > > Couldn't it be done in an END block inside DynaLoader?
> 
> Too early.  The only safe place (if any) should be
> after-the-end-of-global-destruction (assuming the list is kept in a C
> structure, thus is indestructible).

Good point, but I'm not so sure. Objects have been cleaned, via
sv_clean_objs(), before the END blocks are called.  (Umm, I don't see
any mention in the docs that objects will have been destroyed before
END blocks are called.)

If destruct_level==0 then that's just about the last thing
perl_destruct() does before calling return.

If destruct_level > 0 then there's lots of SvREFCNT_dec'ing going on
and sv_clean_all() etc but I don't think they'd trigger execution of
any XS code.

Also the dlclose's should be skipped unless perl_destruct_level > 0.
Otherwise it'll slowdown perl's overall run time for everyone.

Other random observation, I see that the PERL_DESTRUCT_LEVEL env var
value is checked in perl_destruct() but not propogated to the
PL_perl_destruct_level global.

Tim.


Follow-Ups from:
Ilya Zakharevich <ilya@math.ohio-state.edu>
References to:
Alan Burlison <Alan.Burlison@uk.sun.com>
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]