From: Jarkko Hietaniemi Date: Sun, 9 Jun 2002 15:40:52 +0000 (+0000) Subject: CLONE doc tweaks. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ebc451bd0ba36823aced89b266c63cb608ab0c7;p=p5sagit%2Fp5-mst-13.2.git CLONE doc tweaks. p4raw-id: //depot/perl@17134 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 56d9cad..416baae 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -690,11 +690,13 @@ in split>. =item * -Support for the C keyword had been added. With ithreads, when a -new thread is created, all perl data is cloned, however non perl data -cannot be cloned. C will be executed once for every package -that has it defined or inherited. It will be called in the context of -the new thread, so all modifications are made in the new area. +Support for the C special subroutine had been added. +With ithreads, when a new thread is created, all Perl data is cloned, +however non-Perl data cannot be cloned automatically. In C you +can do whatever you need to do, like for example handle the cloning of +non-Perl data, if necessary. C will be executed once for every +package that has it defined or inherited. It will be called in the +context of the new thread, so all modifications are made in the new area. See L diff --git a/pod/perlmod.pod b/pod/perlmod.pod index ca59e29..029f41b 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -486,12 +486,14 @@ interpreter threads. These threads can be used explicitly and implicitly. Ithreads work by cloning the data tree so that no data is shared between different threads. These threads can be used using the threads -module or by doing fork() on win32 (fake fork() support). When a thread is -cloned all perl data is cloned, however non perl data cannot be cloned. -Perl after 5.7.2 has support for the C keyword. C will be -executed once for every package that has it defined (or inherits it). -It will be called in the context of the new thread, so all modifications -are made in the new area. +module or by doing fork() on win32 (fake fork() support). When a +thread is cloned all Perl data is cloned, however non-Perl data cannot +be cloned automatically. Perl after 5.7.2 has support for the +C keyword. In C you can do whatever you need to do, +like for example handle the cloning of non-Perl data, if necessary. +C will be executed once for every package that has it defined +(or inherits it). It will be called in the context of the new thread, +so all modifications are made in the new area. If you want to CLONE all objects you will need to keep track of them per package. This is simply done using a hash and Scalar::Util::weaken().