-Change psh to tend to group readily available output together
-Prevent psh from uselessly looping on an impossible condition (checking for new data from children when they haven't gotten to run( -Change buffer flushes to happen less frequently git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@851 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
38ca232e0b
commit
0c0ec38b6e
@ -14,6 +14,7 @@ use IO::Select;
|
||||
use xCAT::Utils;
|
||||
use Getopt::Long;
|
||||
use POSIX qw(:signal_h :errno_h :sys_wait_h);
|
||||
use Thread qw(yield);
|
||||
my $interface;
|
||||
my $username;
|
||||
my $help;
|
||||
@ -109,16 +110,21 @@ sub processoutput { #This way, one arbiter handles output, no interrupting
|
||||
my $rc = @readyins;
|
||||
my $readyh;
|
||||
foreach $readyh (@readyins) {
|
||||
my $line = <$readyh>;
|
||||
unless ($line) {
|
||||
$inputs->remove($readyh);
|
||||
close($readyh);
|
||||
next;
|
||||
}
|
||||
chomp($line);
|
||||
print $nodehdl{$readyh}.": ".$line."\n";
|
||||
IO::Handle::flush(stdout);
|
||||
my $cursel = new IO::Select;
|
||||
$cursel->add($readyh);
|
||||
while ($cursel->can_read(0)) {
|
||||
my $line = <$readyh>;
|
||||
unless ($line) {
|
||||
$inputs->remove($readyh);
|
||||
close($readyh);
|
||||
next;
|
||||
}
|
||||
chomp($line);
|
||||
print $nodehdl{$readyh}.": ".$line."\n";
|
||||
}
|
||||
}
|
||||
IO::Handle::flush(stdout);
|
||||
yield; #Explicitly give all children a chance to refill any buffers
|
||||
return $rc;
|
||||
}
|
||||
sub sshnode {
|
||||
|
Loading…
Reference in New Issue
Block a user