Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: creating unknown number of threads and then join results

by rudds_perl_habit (Novice)
on Jul 30, 2013 at 18:43 UTC ( #1047099=note: print w/ replies, xml ) Need Help??


in reply to Re^3: creating unknown number of threads and then join results
in thread creating unknown number of threads and then join results

I think I stumbled onto the answer. According to this article, the chdir command is not thread-safe. See http://www.perl.com/pub/2002/06/11/threads.html. See the section about 2/3 the way down titled "Altering Perls behavior to be thread-safe, ex::threads::cwd" . They give an example of how to "fix" it, too. In my script, I use "chdir" only if running the ClearCase commands, which explains why it is failing. I'll have to re-examine how I am doing that, or implement the fix in the article above.


Comment on Re^4: creating unknown number of threads and then join results
Re^5: creating unknown number of threads and then join results
by BrowserUk (Pope) on Jul 30, 2013 at 18:54 UTC
    "Altering Perls behavior to be thread-safe, ex::threads::cwd" .

    Ah! That's a situation I've never encountered because Windows has an inherent notion of per-thread cwd.

    That is, chdir is threadsafe on windows where I do all my programming.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: creating unknown number of threads and then join results (ex::threads::safecwd)
by Anonymous Monk on Jul 31, 2013 at 00:22 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-12-25 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls