Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by oiskuu (Pilgrim)
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 taking refuge in the Monastery: (15)
As of 2014-10-21 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (105 votes), past polls