Threads share U area , thats where file descripters are stored for your
process. All threads are in one process. I sedjest using semaphors for
contolling access to any resources.

Mark
----- Original Message -----
From: "Beau E. Cox" <[EMAIL PROTECTED]>
To: "'Beginners" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 4:41 AM
Subject: How 'global' are STDIN/STDOUT/STDERR?


> Hi all -
>
> I am developing a perl 5.8 application using the
> new threading model. I use this technique
> (thanks Jenda!) to dup STDIN to a temp file handle:
>   ...
>   open SAVIN, '<&STDIN';
>   open (STDIN,'<&' . $tmpfh->fileno) or die "...";
>   my $out = `some-command 2>&1`;
>   open STDIN, '<&SAVIN';
>   close $tmpfh;
>   ...
> in various threads. All works - the command run
> reads from STDIN and output to STDOUT (maybe
> STDERR also). I get the output in $out.
>
> My question: how 'global' is STDIN? Must I place
> a lock on some dummy shared variable when using
> STDIN in a thread, in other words, will all
> threads 'see' the dup of STDIN?
>
> Aloha => Beau;
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to