in reply to Re: How I'm sure syswrite has finished?
in thread How I'm sure syswrite has finished?

I tried this:
153 foreach (@str_handles) { 154 my $pid = $pm->start and next; 155 156 $b = syswrite $_->{handle}, 157 join(" ", 158 $_->{chunksize}, 159 $_->{A_cols}, 160 @A_lines[$_->{start}.. $_->{end}], 161 @B_lines, 162 "\cN" 163 ); 164 # Wait until the writing has finished 165 #sleep(1); 166 $pm->finish; 167 } 168 $pm->wait_all_children;
But the behavior is the same.

Only the sleep seems to work.

My guess is that

$pm->finish;
produces a "fake termination": the local process ends while the remote is still writing?

Replies are listed 'Best First'.
Re^3: How I'm sure syswrite has finished?
by perl5ever (Pilgrim) on Mar 16, 2009 at 05:16 UTC
    I think you need to show us more of your program - especially the part wher eyou create the ssh connections.

    Also, the output of strace or truss would help.