diff --git a/examples/allmaps.cc b/examples/allmaps.cc index a404653..89b1ac0 100644 --- a/examples/allmaps.cc +++ b/examples/allmaps.cc @@ -56,7 +56,14 @@ int main(int, char **) test_set>(make_2int); test_set>(make_2string); - // example of using default parameters in order to specify the mutex type + // example of using default parameters in order to specify the mutex type. + // + // Please be aware that the iterators returned (by find for example) cannot + // be safely read in a multithreaded environment. Instead use if_contains(), + // which passes a reference value to the callback while holding the submap lock. + // Similarly, write access can be done safely using modify_if, try_emplace_l + // or lazy_emplace_l. + // ---------------------------------------------------------------------------- using Map = phmap::parallel_flat_hash_map, std::equal_to,