Thread fork() wirft Fehler Free to wrong pool (Windows) (21 answers)
Opened by bianca at 2013-09-26 07:53

bianca
 2013-09-26 08:00
#170651 #170651
User since
2009-09-13
6977 Artikel
BenutzerIn

user image
Wenn ich die Auftragsdatei sofort nach ihrem Auffinden umbenenne nützt das auch nur ein bisschen, der Fehler bleibt aber.
Code (perl): (dl )
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
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;

print "Start\n";
my $lauf = 1;
while ($lauf) {
    if (opendir my $vh,'.') {
        foreach my $file (
            grep {
                $_ =~ /^[a-z0-9]\-auftrag.dat$/
                    &&
                !-z $_
            }
            readdir $vh
        ) {
            print "Datei $file gefunden\n";
            my $pid;
            if (!($pid = fork())) {
                # Sohn
                rename($file,"$file-erl");
                print "Sohn gestartet\n";
                sleep(5);
            }
        }
    }
    print "Warte\n";
    sleep(2);
}
print "Ende\n";

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
Start
Datei 1-auftrag.dat gefunden
Warte
Sohn gestartet
Warte
Warte
Warte
Warte
Free to wrong pool 1d6bd50 not 563f18 at test_daemon.pl line 29.
Warte
Warte
10 print "Hallo"
20 goto 10

View full thread fork() wirft Fehler Free to wrong pool (Windows)