summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/threads.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/threads.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/threads.pm33
1 files changed, 22 insertions, 11 deletions
diff --git a/Master/tlpkg/tlperl/lib/threads.pm b/Master/tlpkg/tlperl/lib/threads.pm
index 3c558865b53..fcefbcc1fb0 100644
--- a/Master/tlpkg/tlperl/lib/threads.pm
+++ b/Master/tlpkg/tlperl/lib/threads.pm
@@ -5,7 +5,7 @@ use 5.008;
use strict;
use warnings;
-our $VERSION = '1.86';
+our $VERSION = '1.93';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -134,7 +134,17 @@ threads - Perl interpreter-based threads
=head1 VERSION
-This document describes threads version 1.86
+This document describes threads version 1.92
+
+=head1 WARNING
+
+The "interpreter-based threads" provided by Perl are not the fast, lightweight
+system for multitasking that one might expect or hope for. Threads are
+implemented in a way that make them easy to misuse. Few people know how to
+use them correctly or will be able to provide help.
+
+The use of interpreter-based threads in perl is officially
+L<discouraged|perlpolicy/discouraged>.
=head1 SYNOPSIS
@@ -424,11 +434,12 @@ C<$@> associated with the thread's execution status in its C<eval> context.
=item $thr->_handle()
-This I<private> method returns the memory location of the internal thread
-structure associated with a threads object. For Win32, this is a pointer to
-the C<HANDLE> value returned by C<CreateThread> (i.e., C<HANDLE *>); for other
-platforms, it is a pointer to the C<pthread_t> structure used in the
-C<pthread_create> call (i.e., C<pthread_t *>).
+This I<private> method returns a pointer (i.e., the memory location expressed
+as an unsigned integer) to the internal thread structure associated with a
+threads object. For Win32, this is a pointer to the C<HANDLE> value returned
+by C<CreateThread> (i.e., C<HANDLE *>); for other platforms, it is a pointer
+to the C<pthread_t> structure used in the C<pthread_create> call (i.e.,
+C<pthread_t *>).
This method is of no use for general Perl threads programming. Its intent is
to provide other (XS-based) thread modules with the capability to access, and
@@ -785,7 +796,7 @@ current operation has completed. For instance, if the thread is I<stuck> on
an I/O call, sending it a signal will not cause the I/O call to be interrupted
such that the signal is acted up immediately.
-Sending a signal to a terminated thread is ignored.
+Sending a signal to a terminated/finished thread is ignored.
=head1 WARNINGS
@@ -841,7 +852,7 @@ C<useithreads> configuration option.
Having threads support requires all of Perl and all of the XS modules in the
Perl installation to be rebuilt; it is not just a question of adding the
L<threads> module (i.e., threaded and non-threaded Perls are binary
-incompatible.)
+incompatible).
=item Cannot change stack size of an existing thread
@@ -951,7 +962,7 @@ alarms in threads, set up a signal handler in the main thread, and then use
L</"THREAD SIGNALLING"> to relay the signal to the thread:
# Create thread with a task that may time out
- my $thr->create(sub {
+ my $thr = threads->create(sub {
threads->yield();
eval {
$SIG{ALRM} = sub { die("Timeout\n"); };
@@ -1006,7 +1017,7 @@ the C<-E<gt>kill()> signalling method cannot be used.
=item Returning closures from threads
-Returning closures from threads should not be relied upon. Depending of the
+Returning closures from threads should not be relied upon. Depending on the
Perl version and the application code, results may range from success, to
(apparently harmless) warnings of leaked scalar, or all the way up to crashing
of the Perl interpreter.