Re: New console

[email protected] ("smackdab")
Newsgroups perl.ithreads
Message-ID <[email protected]>
Can't answer this directly, but have you seen these:
http://www.perl.com/pub/a/2002/06/11/threads.html
http://www.perl.com/pub/a/2002/09/04/threads.html


"John Serink" <[email protected]> wrote in message
news:[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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.