Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Thread parallel execution (join blocks)

by arunbhargav (Novice)
on May 08, 2013 at 03:03 UTC ( #1032565=note: print w/ replies, xml ) Need Help??


in reply to Re: Thread parallel execution (join blocks)
in thread Thread parallel execution

Thanks, My interpretation of join was it would only attach this thread to the main thread, not block until it finishes executing. Well, this clears up a lot.


Comment on Re^2: Thread parallel execution (join blocks)
Re^3: Thread parallel execution (join blocks)
by BrowserUk (Pope) on May 08, 2013 at 08:47 UTC
    My interpretation of join was it would only attach this thread to the main thread, not block until it finishes executing.

    I'm not getting on your case here, but this is a common enough misconception that it is worth drawing attention to.

    How could it "attach this thread to the main thread" without "block until it finishes executing"?

    What would "attachment" without "waiting" even mean?

    "join" is an awful method name. The primary purpose of join is to retrieve the results of the subroutine that was run in the thread.

    If the thread has finished before the call to join is made, then it can return immediately. However, if the thread hasn't finished, then join has no option but to wait until it does.


    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-12-22 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (110 votes), past polls