perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Ing-Simmons <>
Subject Re: [PATCH] libperl leaks a THREAD_KEY each time it is reloaded
Date Tue, 11 Jan 2005 15:34:40 GMT
Gisle Aas <> writes:
>The thread key is not property of an interpreter.  It is a single
>global shared between all the threads running in the process space.
>Same goes for PL_curinterp, it's a true global.  The concept of having
>different interpeters use different thread keys does not make sense.

It _could_ make sense. You could have an one interpreter per thread with 
OS key for thread-local data accessed via the thread_key.
In such a scheme variable should obviously not be a true global
but an intepreter one. PL_curinterp is a hack from our pre-threaded days
and something needs to ensure that one thread owns it at a time.

>> Moreover if perl does get fixed, this modperl2 case is certainly going
>> to crash, since it'll destroy the key but other parent interpreters
>> sharing it will be still running. My test program demonstrates that
>> quite clearly.
>Are you talking about my "perl_fini" patch as the fix here?  The key
>is not destroyed until the code is about to go (at dlclose time).  If
>other threads are still running they should segfault when the text
>segment gets unmapped during dlclose, i.e. this can't happen.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message