Re: Question about threads and return codes
[email protected] ("Jerry D. Hedden") Wed, 13 Dec 2006 13:39:54 -0800 (PST)
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <[email protected]> |
Ransom Briggs asked: > I'm working on a threaded perl program whose function is basically > made > up of one master thread and multiple worker threads which are fed > commands to run. The problem that I'm having conceptually is if I > can > safely use the variable $?, is this defined per thread or per > process? > ie: if I have multiple commands running at the same time would it be > possible for the following interaction to happen? thread1 runs a > command which writes 0 to $?, thread2 runs a command which writes 1 > to > $?, then thread1 and thread2 both read $? and see a 1. $? is not shared between threads. What you want to do will work fine. ____________________________________________________________________________________ Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.