For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > February 2006 > having pblm with thread script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author having pblm with thread script
saggy

2006-02-07, 3:51 am

why the below script is not running, i'm unable to kill the child thread, if anybody has any idea plz tell me,
thnx in advance

if (!defined($kidpid = fork()))
{
# fork returned undef, so failed
die "cannot fork: $!";
}
elsif ($kidpid == 0)
{
# fork returned 0, so this branch is the child
while (1)
{
print("s");
}
}
else
{

sleep(3);
$kill_status = kill 9,0;
print "program killed","$kill_status";

}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com