You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless otherwise documented, all S2 classes have the same thread-safety properties as std::vector: const methods are thread-safe, and non-const methods are not thread-safe.
So for example you issue multiple queries at the same time, but updates to the index cannot overlap any other operations.
// Locking is used to ensure that MutableS2ShapeIndex// has the same thread-safety properties as "vector": const methods are// thread-safe, while non-const methods are not thread-safe. This means that// if one thread updates the index, you must ensure that no other thread is// reading or updating the index at the same time.
@ericveach Should we add something similar on S2ShapeIndex? The Minimize() comment implies this, but it's easy to miss.
Probably. Of course someone could write an S2ShapeIndex subtype with
different thread safety properties if desired, but there doesn't seem to be
any harm in documenting that the abstract method is not required to be
thread-safe.
Activity
ericveach commentedon Jan 17, 2018
Unless otherwise documented, all S2 classes have the same thread-safety properties as std::vector: const methods are thread-safe, and non-const methods are not thread-safe.
So for example you issue multiple queries at the same time, but updates to the index cannot overlap any other operations.
jmr commentedon Jan 17, 2018
This is documented on
MutableS2ShapeIndex:@ericveach Should we add something similar on
S2ShapeIndex? TheMinimize()comment implies this, but it's easy to miss.ericveach commentedon Jan 17, 2018
jmr commentedon Jan 19, 2018
Now documented on
S2ShapeIndexas well.