develooper Front page | perl.perl5.porters | Postings from October 2006

RE: threads module falsely assumes that its BOOT section is executed only once per process

From:
Jan Dubois
Date:
October 27, 2006 16:58
Subject:
RE: threads module falsely assumes that its BOOT section is executed only once per process
Message ID:
002301c6fa23$c615bab0$52413010$@com
Dave wrote:
> On Fri, Oct 27, 2006 at 01:25:39PM -0700, Jan Dubois wrote:
> > Well, the MY_CXT macro may not support this directly, but they are
> > just syntactic sugar around storing values in the PL_modglobal hash
> > to avoid the hash access if you compile without MULTIPLICITY.
> 
> Er, I completely rewrote the MY_CXT* macros a few months ago to make them
> a lot more efficient; they no longer use PL_modglobal, and only provide
> one struct per source file - due to a static var per file (see START_MY_CXT).

Sorry, I completely forgot about this.

But anyways, PL_modglobal is still around to store per-interpreter
module data if one wants to use it.

Another (better) idea is to have 2 additional fields in the MY_CXT data:
one that stores the BOOT tid, and a pointer to the "global to the pool"
data. That way every thread can access this data through the MY_CXT,
and the BOOT thread can then free it when it is being destructed.

Either way, I think it is very desirable to *not* add additional
core variables if not absolutely necessary.

Cheers,
-Jan 




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About