Commit 9c9de608 authored by Olav Kvittem's avatar Olav Kvittem
Browse files

100ms sleep

parent dbfde1c4
Pipeline #45624 passed with stages
in 53 seconds
#!/usr/bin/perl
# spread file input to parallel commands on a measurement point
# using internal buffers
# using internal buffers/debug
my $debug=0;
use threads;
......@@ -49,8 +49,8 @@ if ( $#opt_cmd >= 0 ){ # externally spec'd commands
$opt_v=1;
}
$SIG{INT} = 'summary';
$SIG{TERM} = 'summary';
$SIG{INT} = 'final_summary';
$SIG{TERM} = 'final_summary';
my @queues=();
my @fh=();
......@@ -74,7 +74,7 @@ while(<>){
if ( $blocked[$i] > 0 ){
printf "blocked index %d for %d\n", $i, $blocked[$i] if $opt_debug && $blocked[$i] > 1;
usleep(1000 * $blocked[$i]); # additive increase in sleep_time
usleep(100 * $blocked[$i]); # additive increase in sleep_time
$n_slept[$i] ++;
$t_slept[$i] += $blocked[$i];
}
......@@ -111,6 +111,11 @@ sub summary{
}
}
sub final_summary{
summary();
exit(1);
}
sub set_pipe_size{
my $fh = shift;
my $pipe_size = shift;
......
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