perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [PATCH] libperl leaks a THREAD_KEY each time it is reloaded
Date Tue, 11 Jan 2005 19:58:14 GMT
Jan Dubois wrote:
> On Tue, 11 Jan 2005, Stas Bekman wrote:
> 
>>So each parent interpeter should be totally independent from other
>>parent interpreters. I'm not sure if sharing the key is possible.
>>Since you will end up with two threads from totally different pools
>>using the same thread key. Or is it just fine?
> 
> 
> This is not only fine, it is exactly as is should be: the thread key is
> just a pointer to a thread local storage slot, which is an *index* into
> the local stack.  So while the index is the same for each thread, the
> actual memory location it points to in each thread is different.  This
> means that Perl can find the current Perl interpreter by looking it
> up at a fixed offset in the thread's stack.  This obviously only works
> if the offset (thread key) is the same for each interpreter.

Thanks Jan. I now understand that.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message