Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: thread ids stringifying wrong in v5.12.4?

by samwyse (Scribe)
on Dec 17, 2012 at 18:36 UTC ( #1009213=note: print w/replies, xml ) Need Help??

in reply to Re: thread ids stringifying wrong in v5.12.4?
in thread thread ids stringifying wrong in v5.12.4?

Strictly speaking, I wasn't storing the thread handles in a hash, I was wanting to use them as keys. This is because I wanted to associate information for each thread (i.e. the parameters used when started). Using the tid() method solved that problem.

I'm unsure that your code for joining the threads is useful to me, as it seems that it would wait for the first thread to finish before checking any others. Since some of the threads may hang, this would not solve my stated problem. I do agree that using a sleep loop isn't optimal, and I should look for a better way to wait for threads to exit.

  • Comment on Re^2: thread ids stringifying wrong in v5.12.4?

Replies are listed 'Best First'.
Re^3: thread ids stringifying wrong in v5.12.4?
by BrowserUk (Pope) on Dec 17, 2012 at 19:11 UTC
    some of the threads may hang

    How do you handle not getting the return value from those threads that hang?

    How will you clean those threads up when your program ends?

    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.

    RIP Neil Armstrong

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009213]
[Corion]: Grrr. I thought I had started work on Filter::Simple in a feature branch but it seems that I haven committed to the master branch instead :-(
[choroba]: just cherry pick the commits to a feature branch and reset/revert the master
[Corion]: choroba: Yeah - as this is not an official repository, I don't mind about ruining other peoples clones of that ;)
[choroba]: oh, if you already pushed, you should revert
[Corion]: choroba: Naah, I don't mind rewriting history, at least when it is in my favour ;)
[Corion]: Ruining other peoples clones is not nice, but as I only have that repo to (later) show people when I encounter problems, I don't mind that
[Corion]: I should look into self-hosting gitprep instead of relying so much on github

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-01-23 10:29 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (192 votes). Check out past polls.