diff --git a/README.md b/README.md index 39ba4c3..e942fb6 100644 --- a/README.md +++ b/README.md @@ -141,21 +141,23 @@ void _fill_random_inner_mt(int64_t cnt, HT &hash, RSU &rsu) if (idx / modulo == thread_idx) // if the subtable is suitable for this thread { hash.insert(typename HT::value_type(key, 0)); // insert the value - ++(num_keys[thread_idx]); // increment count of inserted values + ++(num_keys[thread_idx]); // increment count of inserted values } } }; + // create and start 8 threads - each will insert in their own submaps + // thread 0 will insert the keys whose hash direct them to submap0 or submap1 + // thread 1 will insert the keys whose hash direct them to submap2 or submap3 + // -------------------------------------------------------------------------- for (int64_t i=0; i td {i, num_threads, cnt, hash, rsu}; threads[i].reset(new std::thread(thread_fn, i, rsu)); - } // rsu passed by value to threads... we need to increment the reference object for (int64_t i=0; ijoin(); } diff --git a/bench.cc b/bench.cc index 3c4dc78..0d6dfc9 100644 --- a/bench.cc +++ b/bench.cc @@ -181,16 +181,18 @@ void _fill_random_inner_mt(int64_t cnt, HT &hash, RSU &rsu) #endif }; + // create and start 8 threads - each will insert in their own submaps + // thread 0 will insert the keys whose hash direct them to submap0 or submap1 + // thread 1 will insert the keys whose hash direct them to submap2 or submap3 + // -------------------------------------------------------------------------- for (int64_t i=0; i td {i, num_threads, cnt, hash, rsu}; threads[i].reset(new std::thread(thread_fn, i, rsu)); - } // rsu passed by value to threads... we need to increment the reference object for (int64_t i=0; ijoin(); }