
10 Nov
2008
10 Nov
'08
9:43 p.m.
Daniel James wrote:
2008/11/10 Kenny Riddile
: This is a simple question, but a quick search didn't turn up any answers. Is it safe for multiple readers to access a boost::unordered_map concurrently?
Yes, as long as nothing modifies it (and the key and mapped object, hash function and key predicate are appropriately safe, of course). This is the same as any STL container.
Daniel
I could be wrong, but I don't think the standard says anything about the thread safety of STL containers, so it's implementation-specific. Still, it's good to know that using boost::unordered_map this way is ok.