develooper Front page | perl.perl5.porters | Postings from August 2009

Re: [perl #66158] fork crashes on perl 5.10.0/Win32 [PATCH proposal]

From:
Vincent Pit
Date:
August 5, 2009 07:02
Subject:
Re: [perl #66158] fork crashes on perl 5.10.0/Win32 [PATCH proposal]
Message ID:
9b0a6aeb1803e33d183da1560d6d5f77.squirrel@ssl0.ovh.net
Thanks for this.

> On Wed, Aug 05, 2009 at 03:16:05PM +0200, Vincent Pit wrote:
>> > The thing that puzzles me is that is doesn't explode on 5.8.x.
>>
>> I've no idea about why it works with 5.8, nor why the pointer table is
>> flushed for the fork emulation but not for threads.

Now I know why it doesn't crash on 5.8 : I explicitely disabled
Variable::Magic thread safety for those.

> That was a change to threads.xs a while ago. Originally neither kept the
> table around - its an expensive use of memory (at least 12 bytes per SV
> etc per thread).

threads.pm manually destroys the pointer table after the new interpreter
is created. It should theorically be fine to just shove a
ptr_table_free(PL_ptr_table) right after the call to perl_clone_using() in
PerlProcFork(). The pointer table has to be alive when CLONE is called,
not after.

Vincent.




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