1 2
my $threadGetCurrentData = threads->new(\&getStockData::getCurrentStockData, $currentQueue)->detach(); my $threadProcessCurrentData = threads->new(\&windowCurrent())->detach();
Guest chris05133Hat jemand einen Tipp woran es liegen könnte?
QuoteDas Hauptprogramm müsste doch regülär weiterlaufen oder?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
use Carp; use strict; use warnings; use threads; my $thread1= threads->new(\&test, "Erster Thread")->detach(); my $thread2 = threads->new(\&test2())->detach(); my $a = 0; for(;;) { sleep 1; print "Mainthread: " . $a++ . "\n"; } sub test { my $thread = @_; my $i = 0; for(;;) { sleep 1; print $thread . " " . $i++ . "\n"; } } sub test2 { my $i = 0; for (;;) { sleep 1; print "zweiter Thread: " . $i++ . "\n"; } }
1 2
my $thread1= threads->new(\&test, "Erster Thread")->detach(); my $thread2= threads->new(\&test, "Zweiter Thread")->detach();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
use Carp; use strict; use warnings; use threads; my $thread1= threads->new(\&test, "Erster Thread")->detach(); my $thread2 = threads->new(\&test2())->detach(); my $a = 0; for(;;) { sleep 1; print "Mainthread: " . $a++ . "\n"; } sub test { my $thread = @_; my $i = 0; for(;;) { sleep 1; print $thread . " " . $i++ . "\n"; } } sub test2 { my $i = 0; for (;;) { sleep 1; print "zweiter Thread: " . $i++ . "\n"; } }
my $thread2 = threads->new(\&test2())->detach();