Re: Subtle MT problem with __gnu_cxx::hash_map

2004-11-19 Thread Paul Dubuc
Matt Austern wrote: But operator[] isn't read access. It's defined to be equivalent to a certain form of insert(). Not just insert() but find() too. So it's both read and write access. I think there's enough ambiguity to warrant the simple change I suggested if it's really feasible. -- Pau

Re: Subtle MT problem with __gnu_cxx::hash_map

2004-11-19 Thread Matt Austern
On Nov 19, 2004, at 12:21 PM, Paul Dubuc wrote: There's a subtle thread safety problem with hash_map that was found in our testing recently. It's understood that operator[] is a non-const method since it can insert an element into a container if one is not found with the given index. In our ca

Subtle MT problem with __gnu_cxx::hash_map

2004-11-19 Thread Paul Dubuc
There's a subtle thread safety problem with hash_map that was found in our testing recently. It's understood that operator[] is a non-const method since it can insert an element into a container if one is not found with the given index. In our case we were using operator[] to access a hash_map