Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Threads From Hell #1: How To Share A Hash

by karlgoethebier (Abbot)
on May 13, 2015 at 21:16 UTC ( [id://1126606]=note: print w/replies, xml ) Need Help??


in reply to Re: Threads From Hell #1: How To Share A Hash
in thread Threads From Hell #1: How To Share A Hash [SOLVED]

"...whatever it was, it wasn't doing anything useful."

Well, i would say it depends.

It was for learning purposes, a kind of finger exercise.

I didn't mention that i don't have any experience using threads in Perl. My first approach.

I always felt like i'll miss something if i don't go over that next bridge.

My little effort was also inspired by my last thread about P::FM, because that stuff doesn't work on windows. I am sorry that i can't show the error messages, because i don't have a windows box with Perl installed at my disposal tonight.

Also pure curiosity played a role. I have a basic understanding how a counting semaphore works but this stuff is still a kind of magic for me.

And the code i figured out looks very similar to my forking example and doesn't perform so bad.

That's why i couldn't resist.

My very best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

  • Comment on Re^2: Threads From Hell #1: How To Share A Hash

Replies are listed 'Best First'.
Re^3: Threads From Hell #1: How To Share A Hash
by BrowserUk (Patriarch) on May 13, 2015 at 21:23 UTC
    And the code i figured out looks very similar to my forking example and doesn't perform so bad.

    So... you were trying to restrict the number of concurrent threads to 4? Yes. It works for that purpose.

    (I originally thought is was some attempt to prevent concurrent access to the shared hash; ie. a substitute for lock. My mistake.)


    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". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-24 06:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found