develooper Front page | perl.perl5.porters | Postings from January 2011

Re: Turn $$ into a magical readonly variable that always fetchesgetpid()

Thread Previous | Thread Next
From:
Simon Wistow
Date:
January 3, 2011 13:32
Subject:
Re: Turn $$ into a magical readonly variable that always fetchesgetpid()
Message ID:
20110103213222.GC91026@thegestalt.org
On Wed, Dec 29, 2010 at 04:35:24PM +0100, Max Maischein said:
> This is a bug opportunity, because if XS calls fork(3) or an embedding 
> application calls fork(3), Perls notion of $$ and the value of getpid() can 
> go out of sync, unless the C code takes special care to update $$.

For what it's worth Whatif.pm (which fakes reversible computing using 
fork() and more than a touch of crack) explicitly modifies $$ as part of 
its smoke and mirrors and, IIRC, it stole the code to do that from 
PPerl.

http://cpansearch.perl.org/src/SIMONW/Whatif-1.3/Whatif.xs



Thread Previous | Thread Next


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