Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Is it possible to create a single Hash-of-Hash.. with multiple threads..

by oiskuu (Friar)
on Mar 14, 2014 at 14:36 UTC ( #1078337=note: print w/ replies, xml ) Need Help??


in reply to Is it possible to create a single Hash-of-Hash.. with multiple threads..

You need not share the input db (unless it's later modified). Just read it before starting the threads and they all inherit a copy.

In general, having multiple threads work on same data is a recipe for dreadful performance problems. Data lines will constantly migrate between L2 caches; this is quite expensive.

Instead, have each subthread construct a part of the tree, returning a shared_clone. Main thread will build the toplevel hash.


Comment on Re: Is it possible to create a single Hash-of-Hash.. with multiple threads..

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (15)
As of 2014-12-18 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (67 votes), past polls