22 our @ISA = qw(Exporter DynaLoader);
24 our %EXPORT_TAGS = ( all => [qw()]);
26 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
31 our $VERSION = '0.05';
36 return $class->create(@_);
41 return 1 if($_[0]->tid() == $_[1]->tid());
47 bootstrap threads $VERSION;
50 # Preloaded methods go here.
57 threads - Perl extension allowing use of interpreter based threads from perl
65 print "Thread started\n";
69 my $thread = threads->new("start_thread","argument");
71 $thread->new(sub { print "I am a thread"},"argument");
77 $thread = threads->self();
85 Perl 5.6 has something called interpreter threads, interpreter threads are built on MULTIPLICITY and allows for several different perl interpreters to run in different threads. This has been used in win32 perl to fake forks, it has also been available to people embedding perl.
89 =item new, function, LIST
91 This will create a new thread with the entry point function and give it LIST as parameters.
92 It will return the corresponding threads object.
96 This will wait for the corresponding thread to join. When it finishes join will return the return values of the root function.
97 If a thread has been detached, join will return without wait.
99 =item $threads->detach
101 Will throw away the return value from the thread and make non joinable
105 This will return the object for the current thread.
109 This will return the id of the thread.
110 threads->self->tid() is a quick way to get current thread id
119 =item Fix so the return value is returned when you join
123 =item Fix memory leaks!
127 =head1 AUTHOR and COPYRIGHT
129 Artur Bergman <lt>artur at contiller.se<gt>
131 threads is released under the same license as Perl
135 Richard Soderberg <lt>rs at crystalflame.net<gt>
136 Helping me out tons, trying to find reasons for races and other wierd bugs!
138 Simon Cozens <lt>simon at brecon.co.uk<gt>
139 Being there to answer zillions of annoying questions
141 Rocco Caputo <lt>troc at netrus.net<gt>
143 Vipul Ved Prakash <lt>mail at vipul.net<gt>
144 Helping with debugging.
146 please join perl-ithreads@perl.org for more information
152 =item creating a thread from within a thread is unsafe under win32
154 =item PERL_OLD_SIGNALS are not threadsafe, will not be.
160 L<perl>, L<perlcall>, L<perlembed>, L<perlguts>