Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: [Patch mp2] Solving module reloading problems (Apache::Reload) with Mod: msg#00400

apache.mod-perl.devel

Subject: Re: [Patch mp2] Solving module reloading problems (Apache::Reload) with ModPerl::Util::clear_namespace()



Joe Schaefer wrote:
Geoffrey Young <geoff@xxxxxxxxxxxxxxxxxxx> writes:

[...]


what if you want to unload just Foo and not Foo::Bar? CGI and Digest
come to mind...


It's really hard to make module unloading work 100% reliably because

-1) Perl doesn't keep track of all the necessary bits to allow this cleanly ;-)

0) {modules} != {packages} so reloading a module will influence
every package it touches (even the ones you forgot to delete),

Yes, in the case of a module with many package definitions, you are in trouble

1) perl sometimes does compile-time tricks to avoid symbol lookups,

Yup, also true.

2) symbols are occasionally aliased into other namespaces (eg Exporter), and those aliases won't get rebound once the new symbol definitions
are loaded.

Well, partially true. It just means the existing aliases will be pointing to
the _old_ values for that module. Kinda similar to an external module taking a
ref
to a sub in the package.

... I'm sure there's a whole bunch more issues that I'm overlooking (ithreads?) ...

Simply put, Apache::Reload and friends are trying to wipe out a namespace even
though Perl doesn't quite support that. It's doing it's best and I am not sure
it could ever do a 100% clean job (thinking optimizer, for instance).

There's always Symbol::delete_package, but it looks pretty
pedestrian when compared to Philippe's patch. I certainly
don't see any harm done by including it in mp2, since it
may work just fine for the majority of users.

--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Attachment: signature.asc
Description: OpenPGP digital signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
version-control...    qnx.openqnx.dev...    redhat.rhn.user...    ietf.openpgp/20...    mail.mutt.user/...    web.microformat...    java.sync4j.use...    education.ezpro...    user-groups.blu...    solaris.manager...    org.fitug.debat...    technology.erps...    politics.activi...    linux.redhat.fe...    bug-tracking.ma...    xfce.user/2004-...    hams/2004-11/ms...    kde.users.pim/2...    culture.cooking...    freebsd.devel.x...    gnu.m4.adhoc/20...    ngpt.user/2002-...    apple.fink.deve...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation