16 our @ISA = qw(Exporter DynaLoader);
18 our %EXPORT_TAGS = ( all => [qw()]);
20 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
25 our $VERSION = '0.05';
29 return $class->create(@_);
34 return 1 if($_[0]->tid() == $_[1]->tid());
40 bootstrap threads $VERSION;
42 # Preloaded methods go here.
49 threads - Perl extension allowing use of interpreter based threads from perl
56 print "Thread started\n";
59 my $thread = threads->new("start_thread","argument");
61 $thread->new(sub { print "I am a thread"},"argument");
67 $thread = threads->self();
73 Perl 5.6 has something called interpreter threads, interpreter threads
74 are built on MULTIPLICITY and allows for several different perl
75 interpreters to run in different threads. This has been used in win32
76 perl to fake forks, it has also been available to people embedding
81 =item new, function, LIST
83 This will create a new thread with the entry point function and give
84 it LIST as parameters. It will return the corresponding threads
89 This will wait for the corresponding thread to join. When it finishes join will return the return values of the root function.
90 If a thread has been detached, join will return without wait.
92 =item $threads->detach
94 Will throw away the return value from the thread and make non joinable
98 This will return the object for the current thread.
102 This will return the id of the thread.
103 threads->self->tid() is a quick way to get current thread id
112 =item Fix so the return value is returned when you join
116 =item Fix memory leaks!
120 =head1 AUTHOR and COPYRIGHT
122 Artur Bergman E<lt>artur at contiller.seE<gt>
124 threads is released under the same license as Perl
128 Richard Soderberg E<lt>rs at crystalflame.netE<gt>
129 Helping me out tons, trying to find reasons for races and other weird bugs!
131 Simon Cozens E<lt>simon at brecon.co.ukE<gt>
132 Being there to answer zillions of annoying questions
134 Rocco Caputo E<lt>troc at netrus.netE<gt>
136 Vipul Ved Prakash E<lt>mail at vipul.netE<gt>
137 Helping with debugging.
139 please join perl-ithreads@perl.org for more information
145 =item creating a thread from within a thread is unsafe under win32
147 =item PERL_OLD_SIGNALS are not threadsafe, will not be.
153 L<perl>, L<perlcall>, L<perlembed>, L<perlguts>