Hi,
I just got interested in 5.8 threads. I have a simple question
about the first basic example in perlthrtut.
My basic question is how to track the pids, and why does the
following program create 4 pids instead of 3? I would expect
3, one for the parent, and one for each of 2 threads.
So run the following program and watch it with "top c". 4 pids
are generated. What is that extra pid for?
Also does anyone know how to get the individual threads pids?
I can get the tid, but can't seem to find the pid, except the parents.
#!/usr/bin/perl
use threads;
print "I'm the parent pid-> $$\n";
$thr = threads->new(\&sub1);
$thr1 = threads->new(\&sub1);
sleep 25;
sub sub1{
$myobject = threads->self;
$mytid= $myobject->tid;
print "In the thread $myobject $mytid \n";
sleep 20;
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]