Re: Thread safety of C++ Struct/Schema::GetFieldIndex

2019-01-04 Thread Gene Novark
ne. >> >> >> Le 04/01/2019 à 23:17, Wes McKinney a écrit : >>> hi Gene, >>> >>> Yes, feel free to submit a PR to fix this. I would suggest >>> populating function-local std::unordered_map and then move-assigning >>> it into name_to_

Thread safety of C++ Struct/Schema::GetFieldIndex

2019-01-04 Thread Gene Novark
These are both effectively-immutable accessors with lazy initialization. However, when accessed from multiple threads a race can occur initializing the name_to_index_ map. This seems like a bug rather than a purposeful design choice based off the cpp/conventions.rst section on Immutability. I'm