summaryrefslogtreecommitdiff
path: root/pod/perlmod.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-09 15:40:52 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-09 15:40:52 +0000
commit4ebc451bd0ba36823aced89b266c63cb608ab0c7 (patch)
tree8183197bb2c0dde26286643b5cc5797d8e7d062a /pod/perlmod.pod
parent2f9d292c5c854aad638316029276446c19b69bf6 (diff)
downloadperl-4ebc451bd0ba36823aced89b266c63cb608ab0c7.tar.gz
CLONE doc tweaks.
p4raw-id: //depot/perl@17134
Diffstat (limited to 'pod/perlmod.pod')
-rw-r--r--pod/perlmod.pod14
1 files changed, 8 insertions, 6 deletions
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index ca59e2959a..029f41b111 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<CLONE> keyword. C<CLONE> 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<CLONE> keyword. In C<CLONE> you can do whatever you need to do,
+like for example handle the cloning of non-Perl data, if necessary.
+C<CLONE> 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().