私の質問: 「読み取り専用」の const_accessors を使用すると、プログラムがフリーズするのはなぜですか?
API の説明から、1 つのアクセサーと複数の const_accessors (ライター、リーダー) を持つことは問題ないようです。誰かが私に別の話をしてくれるかもしれません。
私が達成しようとしている目標は、この同時ハッシュ マップを使用し、10 ~ 200 のスレッドで利用できるようにして、情報を検索および追加/削除できるようにすることです。私が現在使用しているソリューションよりも優れたソリューションがある場合は、代替案を投稿してください。
tbb::size_t hashInitSize = 1200000;
concurrent_hash_map<long int,char*> hashmap(hashInitSize);
cout << hashmap.bucket_count() << std::endl;
long int l = 200;
long int c = 201;
concurrent_hash_map<long int,char*>::accessor o;
concurrent_hash_map<long int,char*>::const_accessor t;
concurrent_hash_map<long int,char*>::const_accessor h;
cout << "Trying to find 200 "<< hashmap.find(t,200) << std::endl;
hashmap.insert(o,l);
o->second = "testother";
TBB コミュニティ チュートリアル ガイドページ 43 では、アクセサの概念について説明しています。