Using Concurrent Hash Map.

Using Concurrent Hash Map.

I am a student, and I am researching concurrent data structures. I don't have much experience in C++ templates/classes. However I understand the concepts.My main problem is understanding how to call basic insert, get and delete operations on the hash map.here is my code:struct HashCompare { static size_t hash( const K& key ) { return tbb::tbb_hasher(key); } static bool equal( const K& key1, const K& key2 ) { return ( key1 == key2 ); } };typedef tbb::concurrent_hash_map > hash_t;hash_t *hash;//Prefillfor(i = start; i < operations+start; i++){ int op=(int)random()%100; if(op<=get_rate){ hash_t::accessor a; hash->find(a,i); } else if (op<=insert_rate){ value=(int)random(); hash_t::accessor a; hash->insert(a,value); } else{//get rate hash->erase(value); } }When I run my code i get a bunch of erros, that don't make much sense to me, see attached file.log.txtAlso how do u set the vale of an accessor?Code:tbb_hash.cc

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.