Some binary tree data structures (such as Splay trees) will be rebalanced when reading to move newly acquired items to the root, so that subsequent search time can be reduced.
Are standard containers allowed ( std::map, std::set)?
At least one problem is thread safety. I used to think that as long as you perform read-only operations on standard containers, it would be safe to do this from multiple threads without introducing mutexes / locks, etc. Perhaps I need to think about this?
I know that typically red-black trees are used for standard tree-like containers and that these data structures usually do not change when reading. But will a hypothetical implementation that modifies match?
My C ++ - standards-foo needs to be improved, but I'm not sure if the current thread safety standard for containers meets. Is this different from c++0x?
source
share