Commit 4647ba07 authored by Olav Kvittem's avatar Olav Kvittem
Browse files

wait and count .. to not to active and not congest pipe

parent c7d60d7c
Pipeline #47272 passed with stages
in 54 seconds
......@@ -93,7 +93,7 @@ foreach $in_file ( @ARGV){
until( $eof == 1 and $remaining_output <= 0){
# empty input queue
my $continue = 1;
while ( !$eof and $continue and my @ready_FHs = $select->can_read( $wait_s)) {
while ( !$eof and $continue++ < 10 and my @ready_FHs = $select->can_read( $wait_s)) {
foreach my $FH (@ready_FHs) { # only one
if ( $! != 0 ) {
die "Error reading $in_file : $!";
......@@ -109,9 +109,9 @@ foreach $in_file ( @ARGV){
}
}
}
if ( ! $is_pipe || $eof == 1) { # not pipe - don't read the whole disk file
$continue=0;
}
# if ( ! $is_pipe || $eof == 1 || $continue++ > 10) { # not pipe - don't read the whole disk file
# $continue=0;
# }
}
$qmax[$i]=$#{$queues[$i]} if ! $qmax[$i] || $qmax[$i] < $#{$queues[$i]};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment