1
2
3
4
5
6
7
8
9
10
sub scrapper {
while(1) {
->Datenbank Zugriff über sub get_data()<-
->Scrappen von Daten<-
->Daten hinzufügen über add_data()<-
->Sleep(1000)<-
}
}
1
2
3
4
5
6
7
8
9
10
sub work {
while(1) {
->Datenbank Zugriff über sub get_scrapped_data()<-
->Arbeiten mit den Daten<-
->Datenbank Eintrag aktualisieren mit dem gearbeitet wurde über sub update_data()<-
sleep(int(rand(5000)) + 3500);
}
}
QuoteThread 1 terminated abnormally: DBD::mysql::db prepare failed: handle 2 is owned by thread 619fb8 not current thread 33ec118 (handles can't be shared between threads and your driver may need a CLONE m
ethod added) at scrap.pl line 175.
1
2
3
4
Perl exited with active threads:
2 running and unjoined
0 finished and unjoined
0 running and detached
1 2 3 4 5 6 7 8
.... threads->create(...) ... while(threads->list(threads::running)) { sleep(1); } for my $thread (threads->list(threads::joinable)) { $thread->join(); }