in reply to Re^6: Multi-threads newbie questions
in thread Multi-threads newbie questions
How would you go about this?
I would avoid fork and threads in the same program--but then on my platform I avoid fork at almost all costs.
On my platform (windows), each thread has it's own current working directory:
c:\test>perl -Mthreads -le"@t = map{ async( sub{ chdir shift;sleep 3;print`cd`} ,$_) } qw[c:\\ c:\\test c:\\test\\_Inline];$_->join for @t" c:\ c:\test c:\test\_Inline
But I seem to remember that doesn't hold true for other platforms.
In any case, I'd simply do:
system "cd $path && theProg @args";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Multi-threads newbie questions
by daverave (Scribe) on Sep 20, 2010 at 16:44 UTC | |
by BrowserUk (Patriarch) on Sep 20, 2010 at 16:49 UTC | |
by daverave (Scribe) on Sep 20, 2010 at 18:53 UTC | |
by BrowserUk (Patriarch) on Sep 20, 2010 at 19:27 UTC | |
by Anonymous Monk on Sep 20, 2010 at 19:47 UTC | |
|