18 our @ISA = qw(Exporter DynaLoader);
20 our %EXPORT_TAGS = ( all => [qw()]);
22 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
27 our $VERSION = '0.05';
32 return $class->create(@_);
37 return 1 if($_[0]->tid() == $_[1]->tid());
43 bootstrap threads $VERSION;
45 # Preloaded methods go here.
52 threads - Perl extension allowing use of interpreter based threads from perl
59 print "Thread started\n";
62 my $thread = threads->new("start_thread","argument");
64 $thread->new(sub { print "I am a thread"},"argument");
70 $thread = threads->self();
76 Perl 5.6 has something called interpreter threads, interpreter threads
77 are built on MULTIPLICITY and allows for several different perl
78 interpreters to run in different threads. This has been used in win32
79 perl to fake forks, it has also been available to people embedding
84 =item new, function, LIST
86 This will create a new thread with the entry point function and give
87 it LIST as parameters. It will return the corresponding threads
92 This will wait for the corresponding thread to join. When it finishes join will return the return values of the root function.
93 If a thread has been detached, join will return without wait.
95 =item $threads->detach
97 Will throw away the return value from the thread and make non joinable
101 This will return the object for the current thread.
105 This will return the id of the thread.
106 threads->self->tid() is a quick way to get current thread id
115 =item Fix so the return value is returned when you join
119 =item Fix memory leaks!
123 =head1 AUTHOR and COPYRIGHT
125 Artur Bergman E<lt>artur at contiller.seE<gt>
127 threads is released under the same license as Perl
131 Richard Soderberg E<lt>rs at crystalflame.netE<gt>
132 Helping me out tons, trying to find reasons for races and other weird bugs!
134 Simon Cozens E<lt>simon at brecon.co.ukE<gt>
135 Being there to answer zillions of annoying questions
137 Rocco Caputo E<lt>troc at netrus.netE<gt>
139 Vipul Ved Prakash E<lt>mail at vipul.netE<gt>
140 Helping with debugging.
142 please join perl-ithreads@perl.org for more information
148 =item creating a thread from within a thread is unsafe under win32
150 =item PERL_OLD_SIGNALS are not threadsafe, will not be.
156 L<perl>, L<perlcall>, L<perlembed>, L<perlguts>