From e77a448e95643a4cf9a0efdaa8fe91d44d97869c Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 29 Nov 2020 11:18:09 -0500 Subject: [PATCH] update comment. --- examples/allmaps.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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,