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 1 if($_[0]->tid() == $_[1]->tid());
33 $threads::threads = 1;
35 bootstrap threads $VERSION;
37 # Preloaded methods go here.
44 threads - Perl extension allowing use of interpreter based threads from perl
51 print "Thread started\n";
54 my $thread = threads->new("start_thread","argument");
56 $thread->new(sub { print "I am a thread"},"argument");
62 $thread = threads->self();
68 Perl 5.6 has something called interpreter threads, interpreter threads
69 are built on MULTIPLICITY and allows for several different perl
70 interpreters to run in different threads. This has been used in win32
71 perl to fake forks, it has also been available to people embedding
76 =item new, function, LIST
78 This will create a new thread with the entry point function and give
79 it LIST as parameters. It will return the corresponding threads
84 This will wait for the corresponding thread to join. When it finishes join will return the return values of the root function.
85 If a thread has been detached, join will return without wait.
87 =item $threads->detach
89 Will throw away the return value from the thread and make non joinable
93 This will return the object for the current thread.
97 This will return the id of the thread.
98 threads->self->tid() is a quick way to get current thread id
107 =item Fix so the return value is returned when you join
111 =item Fix memory leaks!
115 =head1 AUTHOR and COPYRIGHT
117 Artur Bergman E<lt>artur at contiller.seE<gt>
119 threads is released under the same license as Perl
123 Richard Soderberg E<lt>rs at crystalflame.netE<gt>
124 Helping me out tons, trying to find reasons for races and other weird bugs!
126 Simon Cozens E<lt>simon at brecon.co.ukE<gt>
127 Being there to answer zillions of annoying questions
129 Rocco Caputo E<lt>troc at netrus.netE<gt>
131 Vipul Ved Prakash E<lt>mail at vipul.netE<gt>
132 Helping with debugging.
134 please join perl-ithreads@perl.org for more information
140 =item creating a thread from within a thread is unsafe under win32
142 =item PERL_OLD_SIGNALS are not threadsafe, will not be.
148 L<perl>, L<perlcall>, L<perlembed>, L<perlguts>