Add information about portability caveats related to using kill on forked process.
authorbojilund <bo.johansso@lsn.se>
Tue, 7 Jun 2011 08:24:43 +0000 (10:24 +0200)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 7 Jun 2011 15:44:09 +0000 (08:44 -0700)
The outcome of kill on a pseudo-process in Windows is unpredictable
and it should not be used except under dire circumstances.
The process which implements the pseudo-processes can be blocked
and the Perl interpreter hangs.

pod/perlfork.pod

index 709d053..4257b87 100644 (file)
@@ -78,10 +78,12 @@ and return its status.
 =item kill()
 
 C<kill('KILL', ...)> can be used to terminate a pseudo-process by
-passing it the ID returned by fork().  This should not be used except
+passing it the ID returned by fork(). The outcome of kill on a pseudo-process
+is unpredictable and it should not be used except
 under dire circumstances, because the operating system may not
 guarantee integrity of the process resources when a running thread is
-terminated.  Note that using C<kill('KILL', ...)> on a
+terminated.  The process which implements the pseudo-processes can be blocked
+and the Perl interpreter hangs. Note that using C<kill('KILL', ...)> on a
 pseudo-process() may typically cause memory leaks, because the thread
 that implements the pseudo-process does not get a chance to clean up
 its resources.
@@ -307,6 +309,12 @@ are expected to be fixed for thread-safety.
 
 =back
 
+=head1 PORTABILITY CAVEATS
+
+In portable Perl code, C<kill(9, $child)> must not be used on forked processes.
+Killing a forked process is unsafe and have unpredictable results.
+See L</kill()>, above.
+
 =head1 BUGS
 
 =over 8