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

Re: perl@16433

From:
Nicholas Clark
Date:
May 6, 2002 15:24
Subject:
Re: perl@16433
Message ID:
20020506222147.GC4698@Bagpuss.unfortu.net
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:	http://nms-cgi.sourceforge.net/



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