From: Jarkko Hietaniemi Date: Fri, 12 Jul 2002 23:44:17 +0000 (+0000) Subject: threads::shared::queue and semaphore become Thread::Semaphore X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=83272a45226e83bd136d713158e9b44ace2dbc8d;p=p5sagit%2Fp5-mst-13.2.git threads::shared::queue and semaphore become Thread::Semaphore and Queue. The 5005threads case where the old Semaphore and Queue.pm (they are disguised as .pmx) should get magically installed instead has not been tested. p4raw-id: //depot/perl@17509 --- diff --git a/MANIFEST b/MANIFEST index f83fbc0..8135f55 100644 --- a/MANIFEST +++ b/MANIFEST @@ -651,9 +651,11 @@ ext/Thread/list.tx Test getting list of all threads ext/Thread/lock.tx Test lock primitive ext/Thread/Makefile.PL Thread extension makefile writer ext/Thread/Notes Thread notes +ext/Thread/Queue.pmx Threadsafe queue ext/Thread/queue.tx Test Thread::Queue module ext/Thread/README Thread README ext/Thread/README.threads Notes about multithreading +ext/Thread/Semaphore.pmx Threadsafe semaphore ext/Thread/specific.tx Test thread-specific user data ext/Thread/sync.tx Test thread synchronisation ext/Thread/sync2.tx Test thread synchronisation @@ -670,9 +672,7 @@ ext/threads/Changes ithreads ext/threads/Makefile.PL ithreads ext/threads/README ithreads ext/threads/shared/Makefile.PL thread shared variables -ext/threads/shared/queue.pm Threadsafe queue. ext/threads/shared/README thread shared variables -ext/threads/shared/semaphore.pm Threadsafe semaphore ext/threads/shared/shared.pm thread shared variables ext/threads/shared/shared.xs thread shared variables ext/threads/shared/t/0nothread.t Tests for basic shared array functionality. @@ -682,8 +682,6 @@ ext/threads/shared/t/cond.t Test condition variables ext/threads/shared/t/hv_refs.t Test shared hashes containing references ext/threads/shared/t/hv_simple.t Tests for basic shared hash functionality. ext/threads/shared/t/no_share.t Tests for disabled share on variables. -ext/threads/shared/t/queue.t thread shared variables -ext/threads/shared/t/semaphore.t test semaphore ext/threads/shared/t/shared_attr.t Test :shared attribute ext/threads/shared/t/sv_refs.t thread shared variables ext/threads/shared/t/sv_simple.t thread shared variables @@ -1528,8 +1526,10 @@ lib/Text/TabsWrap/t/tabs.t See if Text::Tabs works lib/Text/TabsWrap/t/wrap.t See if Text::Wrap::wrap works lib/Text/Wrap.pm Paragraph formatter lib/Thread.pm Thread extensions frontend -lib/Thread/Queue.pm Thread synchronised queue objects -lib/Thread/Semaphore.pm Thread semaphore objects +lib/Thread/Queue.pm Threadsafe queue +lib/Thread/Queue.t See if threadsafe queue works +lib/Thread/Semaphore.pm Threadsafe semaphore +lib/Thread/Semaphore.t See if threadsafe semaphore works lib/Tie/Array.pm Base class for tied arrays lib/Tie/Array/push.t Test for Tie::Array lib/Tie/Array/splice.t Test for Tie::Array::SPLICE diff --git a/ext/Thread/Queue.pmx b/ext/Thread/Queue.pmx new file mode 100644 index 0000000..4812610 --- /dev/null +++ b/ext/Thread/Queue.pmx @@ -0,0 +1,104 @@ +package Thread::Queue; +use Thread qw(cond_wait cond_broadcast); + +=head1 NAME + +Thread::Queue - thread-safe queues (5.005-threads) + +=head1 CAVEAT + +This Perl installation is using the old unsupported "5.005 threads". +Use of the old threads model is discouraged. + +For the whole story about the development of threads in Perl, and why +you should B be using "old threads" unless you know what you're +doing, see the CAVEAT of the C module. + +=head1 SYNOPSIS + + use Thread::Queue; + my $q = new Thread::Queue; + $q->enqueue("foo", "bar"); + my $foo = $q->dequeue; # The "bar" is still in the queue. + my $foo = $q->dequeue_nb; # returns "bar", or undef if the queue was + # empty + my $left = $q->pending; # returns the number of items still in the queue + +=head1 DESCRIPTION + +A queue, as implemented by C is a thread-safe data structure +much like a list. Any number of threads can safely add elements to the end +of the list, or remove elements from the head of the list. (Queues don't +permit adding or removing elements from the middle of the list) + +=head1 FUNCTIONS AND METHODS + +=over 8 + +=item new + +The C function creates a new empty queue. + +=item enqueue LIST + +The C method adds a list of scalars on to the end of the queue. +The queue will grow as needed to accomodate the list. + +=item dequeue + +The C method removes a scalar from the head of the queue and +returns it. If the queue is currently empty, C will block the +thread until another thread Cs a scalar. + +=item dequeue_nb + +The C method, like the C method, removes a scalar from +the head of the queue and returns it. Unlike C, though, +C won't block if the queue is empty, instead returning +C. + +=item pending + +The C method returns the number of items still in the queue. (If +there can be multiple readers on the queue it's best to lock the queue +before checking to make sure that it stays in a consistent state) + +=back + +=head1 SEE ALSO + +L + +=cut + +sub new { + my $class = shift; + return bless [@_], $class; +} + +sub dequeue : locked : method { + my $q = shift; + cond_wait $q until @$q; + return shift @$q; +} + +sub dequeue_nb : locked : method { + my $q = shift; + if (@$q) { + return shift @$q; + } else { + return undef; + } +} + +sub enqueue : locked : method { + my $q = shift; + push(@$q, @_) and cond_broadcast $q; +} + +sub pending : locked : method { + my $q = shift; + return scalar(@$q); +} + +1; diff --git a/ext/threads/shared/semaphore.pm b/ext/Thread/Semaphore.pmx similarity index 58% rename from ext/threads/shared/semaphore.pm rename to ext/Thread/Semaphore.pmx index bb114dc..8d69ac5 100644 --- a/ext/threads/shared/semaphore.pm +++ b/ext/Thread/Semaphore.pmx @@ -1,23 +1,29 @@ -package threads::shared::semaphore; +package Thread::Semaphore; +use Thread qw(cond_wait cond_broadcast); -use threads::shared; +=head1 NAME -our $VERSION = '1.00'; +Thread::Semaphore - thread-safe semaphores (5.005-threads) -=head1 NAME +=head1 CAVEAT + +This Perl installation is using the old unsupported "5.005 threads". +Use of the old threads model is discouraged. -threads::shared::semaphore - thread-safe semaphores +For the whole story about the development of threads in Perl, and why +you should B be using "old threads" unless you know what you're +doing, see the CAVEAT of the C module. =head1 SYNOPSIS - use threads::shared::semaphore; - my $s = new threads::shared::semaphore; + use Thread::Semaphore; + my $s = new Thread::Semaphore; $s->up; # Also known as the semaphore V -operation. # The guarded section is here $s->down; # Also known as the semaphore P -operation. # The default semaphore value is 1. - my $s = new threads::shared::semaphore($initial_value); + my $s = new Thread::Semaphore($initial_value); $s->up($up_value); $s->down($up_value); @@ -28,8 +34,8 @@ unlike locks, aren't tied to particular scalars, and so may be used to control access to anything you care to use them for. Semaphores don't limit their values to zero or one, so they can be used to -control access to some resource that there may be more than one of. (For -example, filehandles). Increment and decrement amounts aren't fixed at one +control access to some resource that may have more than one of. (For +example, filehandles) Increment and decrement amounts aren't fixed at one either, so threads can reserve or return multiple resources at once. =head1 FUNCTIONS AND METHODS @@ -48,7 +54,7 @@ number. If no number is passed, the semaphore's count is set to one. =item down NUMBER The C method decreases the semaphore's count by the specified number, -or by one if no number has been specified. If the semaphore's count would drop +or one if no number has been specified. If the semaphore's count would drop below zero, this method will block until such time that the semaphore's count is equal to or larger than the amount you're Cing the semaphore's count by. @@ -58,9 +64,9 @@ semaphore's count by. =item up NUMBER The C method increases the semaphore's count by the number specified, -or by one if no number has been specified. This will unblock any thread blocked +or one if no number's been specified. This will unblock any thread blocked trying to C the semaphore if the C raises the semaphore count -above the amount that the Cs are trying to decrement it by. +above what the Cs are trying to decrement it by. =back @@ -68,23 +74,21 @@ above the amount that the Cs are trying to decrement it by. sub new { my $class = shift; - my $val : shared = @_ ? shift : 1; + my $val = @_ ? shift : 1; bless \$val, $class; } -sub down { +sub down : locked : method { my $s = shift; - lock($$s); my $inc = @_ ? shift : 1; - cond_wait $$s until $$s >= $inc; + cond_wait $s until $$s >= $inc; $$s -= $inc; } -sub up { +sub up : locked : method { my $s = shift; - lock($$s); my $inc = @_ ? shift : 1; - ($$s += $inc) > 0 and cond_broadcast $$s; + ($$s += $inc) > 0 and cond_broadcast $s; } 1; diff --git a/ext/threads/shared/Makefile.PL b/ext/threads/shared/Makefile.PL index aa9faa6..18ac115 100755 --- a/ext/threads/shared/Makefile.PL +++ b/ext/threads/shared/Makefile.PL @@ -7,8 +7,6 @@ WriteMakefile( 'VERSION_FROM' => 'shared.pm', # finds $VERSION 'PM' => { 'shared.pm' => '$(INST_LIBDIR)/shared.pm', - 'queue.pm' => '$(INST_LIBDIR)/shared/queue.pm', - 'semaphore.pm' => '$(INST_LIBDIR)/shared/semaphore.pm', }, 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 diff --git a/ext/threads/shared/queue.pm b/ext/threads/shared/queue.pm deleted file mode 100644 index 30b6ea2..0000000 --- a/ext/threads/shared/queue.pm +++ /dev/null @@ -1,102 +0,0 @@ -package threads::shared::queue; - -use threads::shared; -use strict; - -our $VERSION = '1.00'; - -=head1 NAME - -threads::shared::queue - thread-safe queues - -=head1 SYNOPSIS - - use threads::shared::queue; - my $q = new threads::shared::queue; - $q->enqueue("foo", "bar"); - my $foo = $q->dequeue; # The "bar" is still in the queue. - my $foo = $q->dequeue_nb; # returns "bar", or undef if the queue was - # empty - my $left = $q->pending; # returns the number of items still in the queue - -=head1 DESCRIPTION - -A queue, as implemented by C is a thread-safe -data structure much like a list. Any number of threads can safely -add elements to the end of the list, or remove elements from the head -of the list. (Queues don't permit adding or removing elements from -the middle of the list). - -=head1 FUNCTIONS AND METHODS - -=over 8 - -=item new - -The C function creates a new empty queue. - -=item enqueue LIST - -The C method adds a list of scalars on to the end of the queue. -The queue will grow as needed to accommodate the list. - -=item dequeue - -The C method removes a scalar from the head of the queue and -returns it. If the queue is currently empty, C will block the -thread until another thread Cs a scalar. - -=item dequeue_nb - -The C method, like the C method, removes a scalar from -the head of the queue and returns it. Unlike C, though, -C won't block if the queue is empty, instead returning -C. - -=item pending - -The C method returns the number of items still in the queue. - -=back - -=head1 SEE ALSO - -L, L - -=cut - -sub new { - my $class = shift; - my @q : shared = @_; - return bless \@q, $class; -} - -sub dequeue { - my $q = shift; - lock(@$q); - cond_wait @$q until @$q; - cond_signal @$q if @$q > 1; - return shift @$q; -} - -sub dequeue_nb { - my $q = shift; - lock(@$q); - return shift @$q; -} - -sub enqueue { - my $q = shift; - lock(@$q); - push @$q, @_ and cond_signal @$q; -} - -sub pending { - my $q = shift; - lock(@$q); - return scalar(@$q); -} - -1; - - diff --git a/ext/threads/shared/shared.pm b/ext/threads/shared/shared.pm index d464cad..3016039 100644 --- a/ext/threads/shared/shared.pm +++ b/ext/threads/shared/shared.pm @@ -116,7 +116,7 @@ C is equivalent to C, while C is not. Note that you cannot explicitly unlock a variable; you can only wait for the lock to go out of scope. If you need more fine-grained -control, see L. +control, see L. =item cond_wait VARIABLE diff --git a/installperl b/installperl index 8425f5b..ab59652 100755 --- a/installperl +++ b/installperl @@ -386,6 +386,14 @@ foreach my $file (@corefiles) { } } +# Switch in the 5.005-threads versions of he threadsafe queue and semaphore +# modules if so needed. +if ($Config{use5005threads}) { + for my $m (qw(Queue Semaphore)) { + copy("ext/Thread/$m.pmx", "$installprivlib/Thread/$m.pm") + } +} + # Install main perl executables # Make links to ordinary names if installbin directory isn't current directory. diff --git a/lib/Thread/Queue.pm b/lib/Thread/Queue.pm index ebecb74..3b5c7c9 100644 --- a/lib/Thread/Queue.pm +++ b/lib/Thread/Queue.pm @@ -1,44 +1,13 @@ package Thread::Queue; +use threads::shared; use strict; -our $VERSION = '1.00'; - -use Thread qw(cond_wait cond_broadcast); - -BEGIN { - use Config; - if ($Config{useithreads}) { - require 'threads/shared/queue.pm'; - for my $meth (qw(new enqueue dequeue dequeue_nb pending)) { - no strict 'refs'; - *{"Thread::Queue::$meth"} = \&{"threads::shared::queue::$meth"}; - } - } elsif ($Config{use5005threads}) { - for my $meth (qw(new enqueue dequeue dequeue_nb pending)) { - no strict 'refs'; - *{"Thread::Queue::$meth"} = \&{"Thread::Queue::${meth}_othread"}; - } - } else { - require Carp; - Carp::croak("This Perl has neither ithreads nor 5005threads"); - } -} - +our $VERSION = '2.00'; =head1 NAME -Thread::Queue - thread-safe queues (for old code only) - -=head1 CAVEAT - -For new code the use of the C module is discouraged and -the direct use of the C, C and -C modules is encouraged instead. - -For the whole story about the development of threads in Perl, and why you -should B be using this module unless you know what you're doing, see the -CAVEAT of the C module. +Thread::Queue - thread-safe queues =head1 SYNOPSIS @@ -46,16 +15,16 @@ CAVEAT of the C module. my $q = new Thread::Queue; $q->enqueue("foo", "bar"); my $foo = $q->dequeue; # The "bar" is still in the queue. - my $foo = $q->dequeue_nb; # returns "bar", or undef if the queue was - # empty + my $foo = $q->dequeue_nb; # returns "bar", or undef if the queue was empty my $left = $q->pending; # returns the number of items still in the queue =head1 DESCRIPTION -A queue, as implemented by C is a thread-safe data structure -much like a list. Any number of threads can safely add elements to the end -of the list, or remove elements from the head of the list. (Queues don't -permit adding or removing elements from the middle of the list) +A queue, as implemented by C is a thread-safe +data structure much like a list. Any number of threads can safely +add elements to the end of the list, or remove elements from the head +of the list. (Queues don't permit adding or removing elements from +the middle of the list). =head1 FUNCTIONS AND METHODS @@ -68,7 +37,7 @@ The C function creates a new empty queue. =item enqueue LIST The C method adds a list of scalars on to the end of the queue. -The queue will grow as needed to accomodate the list. +The queue will grow as needed to accommodate the list. =item dequeue @@ -85,45 +54,48 @@ C. =item pending -The C method returns the number of items still in the queue. (If -there can be multiple readers on the queue it's best to lock the queue -before checking to make sure that it stays in a consistent state) +The C method returns the number of items still in the queue. =back =head1 SEE ALSO -L +L, L =cut -sub new_othread { +sub new { my $class = shift; - return bless [@_], $class; + my @q : shared = @_; + return bless \@q, $class; } -sub dequeue_othread : locked : method { +sub dequeue { my $q = shift; - cond_wait $q until @$q; + lock(@$q); + cond_wait @$q until @$q; + cond_signal @$q if @$q > 1; return shift @$q; } -sub dequeue_nb_othread : locked : method { - my $q = shift; - if (@$q) { +sub dequeue_nb { + my $q = shift; + lock(@$q); return shift @$q; - } else { - return undef; - } } -sub enqueue_othread : locked : method { +sub enqueue { my $q = shift; - push(@$q, @_) and cond_broadcast $q; + lock(@$q); + push @$q, @_ and cond_signal @$q; } -sub pending_othread : locked : method { - return scalar(@{(shift)}); +sub pending { + my $q = shift; + lock(@$q); + return scalar(@$q); } 1; + + diff --git a/ext/threads/shared/t/queue.t b/lib/Thread/Queue.t similarity index 91% rename from ext/threads/shared/t/queue.t rename to lib/Thread/Queue.t index 259f7f5..33c420b 100644 --- a/ext/threads/shared/t/queue.t +++ b/lib/Thread/Queue.t @@ -5,16 +5,16 @@ BEGIN { push @INC ,'../lib'; require Config; import Config; unless ($Config{'useithreads'}) { - print "1..0 # Skip: might still hang\n"; + print "1..0 # Skip: no ithreads\n"; exit 0; } } use strict; use threads; -use threads::shared::queue; +use Thread::Queue; -my $q = new threads::shared::queue; +my $q = new Thread::Queue; $|++; print "1..26\n"; diff --git a/lib/Thread/Semaphore.pm b/lib/Thread/Semaphore.pm index 51cc0c6..d3ebe63 100644 --- a/lib/Thread/Semaphore.pm +++ b/lib/Thread/Semaphore.pm @@ -1,44 +1,12 @@ package Thread::Semaphore; -use strict; - -our $VERSION = '1.00'; - -use Thread qw(cond_wait cond_broadcast); - -BEGIN { - use Config; - if ($Config{useithreads}) { - require 'threads/shared/semaphore.pm'; - for my $meth (qw(new up down)) { - no strict 'refs'; - *{"Thread::Semaphore::$meth"} = \&{"threads::shared::semaphore::$meth"}; - } - } elsif ($Config{use5005threads}) { - for my $meth (qw(new up down)) { - no strict 'refs'; - *{"Thread::Semaphore::$meth"} = \&{"Thread::Semaphore::${meth}_othread"}; - } - } else { - require Carp; - Carp::croak("This Perl has neither ithreads nor 5005threads"); - } -} +use threads::shared; +our $VERSION = '2.00'; =head1 NAME -Thread::Semaphore - thread-safe semaphores (for old code only) - -=head1 CAVEAT - -For new code the use of the C module is discouraged and -the direct use of the C, C and -C modules is encouraged instead. - -For the whole story about the development of threads in Perl, and why you -should B be using this module unless you know what you're doing, see the -CAVEAT of the C module. +Thread::Semaphore - thread-safe semaphores =head1 SYNOPSIS @@ -60,8 +28,8 @@ unlike locks, aren't tied to particular scalars, and so may be used to control access to anything you care to use them for. Semaphores don't limit their values to zero or one, so they can be used to -control access to some resource that may have more than one of. (For -example, filehandles) Increment and decrement amounts aren't fixed at one +control access to some resource that there may be more than one of. (For +example, filehandles). Increment and decrement amounts aren't fixed at one either, so threads can reserve or return multiple resources at once. =head1 FUNCTIONS AND METHODS @@ -80,7 +48,7 @@ number. If no number is passed, the semaphore's count is set to one. =item down NUMBER The C method decreases the semaphore's count by the specified number, -or one if no number has been specified. If the semaphore's count would drop +or by one if no number has been specified. If the semaphore's count would drop below zero, this method will block until such time that the semaphore's count is equal to or larger than the amount you're Cing the semaphore's count by. @@ -90,31 +58,33 @@ semaphore's count by. =item up NUMBER The C method increases the semaphore's count by the number specified, -or one if no number's been specified. This will unblock any thread blocked +or by one if no number has been specified. This will unblock any thread blocked trying to C the semaphore if the C raises the semaphore count -above what the Cs are trying to decrement it by. +above the amount that the Cs are trying to decrement it by. =back =cut -sub new_othread { +sub new { my $class = shift; - my $val = @_ ? shift : 1; + my $val : shared = @_ ? shift : 1; bless \$val, $class; } -sub down_othread : locked : method { +sub down { my $s = shift; + lock($$s); my $inc = @_ ? shift : 1; - cond_wait $s until $$s >= $inc; + cond_wait $$s until $$s >= $inc; $$s -= $inc; } -sub up_othread : locked : method { +sub up { my $s = shift; + lock($$s); my $inc = @_ ? shift : 1; - ($$s += $inc) > 0 and cond_broadcast $s; + ($$s += $inc) > 0 and cond_broadcast $$s; } 1; diff --git a/ext/threads/shared/t/semaphore.t b/lib/Thread/Semaphore.t similarity index 74% rename from ext/threads/shared/t/semaphore.t rename to lib/Thread/Semaphore.t index 12b0a36..14687e0 100644 --- a/ext/threads/shared/t/semaphore.t +++ b/lib/Thread/Semaphore.t @@ -5,13 +5,13 @@ BEGIN { push @INC ,'../lib'; require Config; import Config; unless ($Config{'useithreads'}) { - print "1..0 # Skip: no threads\n"; + print "1..0 # Skip: no ithreads\n"; exit 0; } } print "1..1\n"; use threads; -use threads::shared::semaphore; +use Thread::Semaphore; print "ok 1\n"; diff --git a/pod/perlmodlib.pod b/pod/perlmodlib.pod index 4018041..067f75d 100644 --- a/pod/perlmodlib.pod +++ b/pod/perlmodlib.pod @@ -1009,11 +1009,11 @@ Manipulate threads in Perl (for old code only) =item Thread::Queue -Thread-safe queues (for old code only) +Thread-safe queues =item Thread::Semaphore -Thread-safe semaphores (for old code only) +Thread-safe semaphores =item Tie::Array diff --git a/pod/perlthrtut.pod b/pod/perlthrtut.pod index 6dab7ed..dbc792d 100644 --- a/pod/perlthrtut.pod +++ b/pod/perlthrtut.pod @@ -682,9 +682,9 @@ synchronization issues. They're pretty straightforward, and look like this: use threads; - use threads::shared::queue; + use Thread::Queue; - my $DataQueue = threads::shared::queue->new; + my $DataQueue = Thread::Queue->new; $thr = threads->new(sub { while ($DataElement = $DataQueue->dequeue) { print "Popped $DataElement off the queue\n"; @@ -698,7 +698,7 @@ this: $DataQueue->enqueue(undef); $thr->join; -You create the queue with C. Then you can +You create the queue with C. Then you can add lists of scalars onto the end with enqueue(), and pop scalars off the front of it with dequeue(). A queue has no fixed size, and can grow as needed to hold everything pushed on to it. @@ -723,9 +723,9 @@ semaphore's current count would decrement below zero. This program gives a quick demonstration: use threads qw(yield); - use threads::shared::semaphore; + use Thread::Semaphore; - my $semaphore = new threads::shared::semaphore; + my $semaphore = new Thread::Semaphore; my $GlobalVariable : shared = 0; $thr1 = new threads \&sample_sub, 1; @@ -768,8 +768,8 @@ one, and up() increments by one. However, we can override any or all of these defaults simply by passing in different values: use threads; - use threads::shared::semaphore; - my $semaphore = threads::shared::semaphore->new(5); + use Thread::Semaphore; + my $semaphore = Thread::Semaphore->new(5); # Creates a semaphore with the counter set to five $thr1 = threads->new(\&sub1); @@ -882,9 +882,9 @@ things we've covered. This program finds prime numbers using threads. 4 use strict; 5 6 use threads; - 7 use threads::shared::queue; + 7 use Thread::Queue; 8 - 9 my $stream = new threads::shared::queue; + 9 my $stream = new Thread::Queue; 10 my $kid = new threads(\&check_num, $stream, 2); 11 12 for my $i ( 3 .. 1000 ) { @@ -897,7 +897,7 @@ things we've covered. This program finds prime numbers using threads. 19 sub check_num { 20 my ($upstream, $cur_prime) = @_; 21 my $kid; - 22 my $downstream = new threads::shared::queue; + 22 my $downstream = new Thread::Queue; 23 while (my $num = $upstream->dequeue) { 24 next unless $num % $cur_prime; 25 if ($kid) { diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 8b0a972..740b0f5 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -2674,13 +2674,13 @@ Memoize::NDBM_File, Memoize::SDBM_File, Memoize::Storable, NDBM_File, NEXT, Net::Cmd, Net::Config, Net::Domain, Net::FTP, Net::NNTP, Net::Netrc, Net::POP3, Net::Ping, Net::SMTP, Net::Time, Net::hostent, Net::libnetFAQ, Net::netent, Net::protoent, Net::servent, O, ODBM_File, Opcode, POSIX, -PerlIO, Pod::Checker, Pod::Find, Pod::Functions, Pod::Html, -Pod::InputObjects, Pod::LaTeX, Pod::Man, Pod::ParseLink, Pod::ParseUtils, -Pod::Parser, Pod::Plainer, Pod::Select, Pod::Text, Pod::Text::Color, -Pod::Text::Overstrike, Pod::Text::Termcap, Pod::Usage, SDBM_File, Safe, -Search::Dict, SelectSaver, SelfLoader, Shell, Socket, Storable, Switch, -Symbol, Term::ANSIColor, Term::Cap, Term::Complete, Term::ReadLine, Test, -Test::Builder, Test::Harness, Test::Harness::Assert, +PerlIO, PerlIO::via::QuotedPrint, Pod::Checker, Pod::Find, Pod::Functions, +Pod::Html, Pod::InputObjects, Pod::LaTeX, Pod::Man, Pod::ParseLink, +Pod::ParseUtils, Pod::Parser, Pod::Plainer, Pod::Select, Pod::Text, +Pod::Text::Color, Pod::Text::Overstrike, Pod::Text::Termcap, Pod::Usage, +SDBM_File, Safe, Search::Dict, SelectSaver, SelfLoader, Shell, Socket, +Storable, Switch, Symbol, Term::ANSIColor, Term::Cap, Term::Complete, +Term::ReadLine, Test, Test::Builder, Test::Harness, Test::Harness::Assert, Test::Harness::Iterator, Test::Harness::Straps, Test::More, Test::Simple, Test::Tutorial, Text::Abbrev, Text::Balanced, Text::ParseWords, Text::Soundex, Text::Tabs, Text::Wrap, Thread, Thread::Queue, @@ -8313,37 +8313,6 @@ method, locked =back -=head2 threadshared::queue, threads::shared::queue - thread-safe queues - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item FUNCTIONS AND METHODS - -new, enqueue LIST, dequeue, dequeue_nb, pending - -=item SEE ALSO - -=back - -=head2 threadshared::semaphore, threads::shared::semaphore - thread-safe -semaphores - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item FUNCTIONS AND METHODS - -new, new NUMBER, down, down NUMBER, up, up NUMBER - -=back - =head2 threadshared::shared, threads::shared - Perl extension for sharing data structures between threads @@ -9049,8 +9018,8 @@ from perl =item DESCRIPTION $thread = threads->create(function, LIST), $thread->join, $thread->detach, -threads->self, $thread->tid, threads->yield();, threads->list();, async -BLOCK; +threads->self, $thread->tid, threads->object( tid ), threads->yield();, +threads->list();, async BLOCK; =item WARNINGS @@ -9093,37 +9062,6 @@ cond_broadcast VARIABLE =back -=head2 threadshared::queue, threads::shared::queue - thread-safe queues - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item FUNCTIONS AND METHODS - -new, enqueue LIST, dequeue, dequeue_nb, pending - -=item SEE ALSO - -=back - -=head2 threadshared::semaphore, threads::shared::semaphore - thread-safe -semaphores - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item FUNCTIONS AND METHODS - -new, new NUMBER, down, down NUMBER, up, up NUMBER - -=back - =head2 utf8 - Perl pragma to enable/disable UTF-8 (or UTF-EBCDIC) in source code @@ -18975,12 +18913,10 @@ join, eval, detach, equal, tid, flags, done =back -=head2 Thread::Queue - thread-safe queues (for old code only) +=head2 Thread::Queue - thread-safe queues =over 4 -=item CAVEAT - =item SYNOPSIS =item DESCRIPTION @@ -18993,12 +18929,10 @@ new, enqueue LIST, dequeue, dequeue_nb, pending =back -=head2 Thread::Semaphore - thread-safe semaphores (for old code only) +=head2 Thread::Semaphore - thread-safe semaphores =over 4 -=item CAVEAT - =item SYNOPSIS =item DESCRIPTION