Hi,
Iam working on Interprocess communication using pipes in Windows platform.
Iam trying to establish communication between two childs of the same parent
process. I have written the program like this.
#!/usr/bin/perl -W
use IO::Handle;
pipe(CHILD1_RDR, CHILD2_WTR);
pipe(CHILD2_RDR, CHILD1_WTR);
CHILD1_WTR->autoflush(1);
CHILD2_WTR->autoflush(1);
$pid = fork();
$pid1 = fork();
if(!$pid)
{
close CHILD1_RDR;
close CHILD1_WTR;
sleep 2;
print CHILD2_WTR "Hi , iam Child 1\n";
chomp($line = <CHILD2_RDR>);
print " Child 1 pid $$ is just reading this: $line\n";
close CHILD2_RDR;
close CHILD2_WTR;
exit;
}
if(!$pid1)
{
close CHILD2_RDR;
close CHILD2_WTR;
chomp($line = <CHILD1_RDR>);
print "Child 2 pid $$ is just reading this: $line\n";
print CHILD1_WTR "Hi, Iam Child 2 \n";
close CHILD1_RDR;
close CHILD1_WTR;
}
The above program is running perfectly on Linux, but when I tried to run
this program in Windows(perl version 5.6.0) still it is running but the
program is not terminating. Can anyone help me in this matter.
Thanks,
Maruti kapa
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]