From: Artur Bergman Date: Mon, 18 Jun 2001 22:06:37 +0000 (+0200) Subject: Documentation changes for CLONE X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2fc0a4050ac9234cb4e9b7764656b322cb30135;p=p5sagit%2Fp5-mst-13.2.git Documentation changes for CLONE Message-ID: p4raw-id: //depot/perl@10694 --- diff --git a/pod/perlmod.pod b/pod/perlmod.pod index 01056f1..29ad67c 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -443,6 +443,23 @@ the module. It is the responsibility of the F<.pm> file to load although the POSIX module happens to do both dynamic loading and autoloading, the user can say just C to get it all. +=head2 Making your module threadsafe + +Perl has since 5.6.0 support for a new type of threads called +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. + +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(). + =head1 SEE ALSO See L for general style issues related to building Perl diff --git a/pod/perlsub.pod b/pod/perlsub.pod index b440cd1..ea7546e 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -207,8 +207,8 @@ core, as are modules whose names are in all lower case. A function in all capitals is a loosely-held convention meaning it will be called indirectly by the run-time system itself, usually due to a triggered event. Functions that do special, pre-defined -things include C, C, C, C, C, and -C--plus all functions mentioned in L. +things include C, C, C, C, C, +C and C--plus all functions mentioned in L. =head2 Private Variables via my()