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..