develooper Front page | perl.perl5.porters | Postings from May 2002

Re: perl@16433

Thread Previous | Thread Next
Nicholas Clark
May 6, 2002 15:24
Re: perl@16433
Message ID:
On Mon, May 06, 2002 at 05:50:38PM +0300, Jarkko Hietaniemi wrote:
> - Storable finishing touches [Nicholas]

As Storable already passes a context object around to make itself thread
safe, and the leaking problem is only that the malloc()ed buffers:
	struct extendable keybuf;	/* for hash key retrieval */
	struct extendable membuf;	/* for memory store/retrieve operations */
	struct extendable msaved;	/* where potentially valid mbuf is saved */

don't get free()ed at thread exit, will it work replacing struct extendable
with an SV? And letting the arena cleanup free the SV at thread exit?

I'm not convinced that using the MT_CXT macros in perl.h is actually needed,
as they are described by this comment

 * Boilerplate macros for initializing and accessing interpreter-local
 * data from C.  All statics in extensions should be reworked to use
 * this, if you want to make the extension thread-safe.  See ext/re/re.xs
 * for an example of the use of these macros, and perlxs.pod for more.

which implies that they are intended for reworking extensions that currently
use static variables.

Nicholas Clark
Even better than the real thing:

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About