New console
[email protected] (John Serink)
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <[email protected]> |
Ok, I want a new thread I am creating to be in its own tty console.
My example code:
use strict;
use warnings;
use threads;
use threads::shared;
my $var : shared;
$var=1;
my $thr = threads->new(\&sub1);
print ("Var is $var\n");
$thr->join();
print ("Var is $var\n");
sub sub1 {
$var++;
# This print statement I want to be in its own console.
print("Inside thread\n");
sleep(2);
return;
}
Any suggestions? I thought it would be easy but it turns on not to be. I
have tried this with fork and can't get that going either.
Cheers,
John