At 09:39 +0100 1/13/03, Teifke Sascha ZFF wrote:
using this code, I got the following Error:
"Can't undef active subroutine during global destruction."
Under non-Windows systems you would probably see something like:

 "A thread exited while X other threads were still running."

which may be more descriptive.


Has anyone a good thread-beginners example I could use to get started?
perldoc perlthrtut


What I want to do is to write a win32 program that needs to call a sub for
every element of a list provided. They do not need to access each others
values.
And what has this got to do with threads?


=======8<========
use threads;
use strict;
my $thread1 = threads->create ( \&Test, "1" );
my $thread2 = threads->create ( \&Test, "2" );
You're starting two threads here


exit;
But you're exiting the program here before the threads have been "joined".

Add:

  $thread1->join;
  $thread2->join;

before the exit and the program should stop without errors.



Liz

Reply via email to