We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have:
template<typename T> struct hash_trie_data { branch_node<T> const* m_root; size_t m_size; };
Then in the copy constructor, we copy as follows:
explicit hash_trie( hash_trie_data<T> const& data ) : m_data( data ) { addref( m_data.m_root ); } hash_trie( hash_trie<T> const& other ) : hash_trie( other.m_data ) {}
But, for example, insert:
template<typename U> auto insert( U &&value ) { if( auto newRoot = inserted( m_data.m_root, std::forward<U>(value) ) ) { release( m_data.m_root ); m_data = { newRoot, size()+1 }; } }
So... insert would race with copy construction on another thread. Give threads A and B
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We have:
Then in the copy constructor, we copy as follows:
But, for example, insert:
So... insert would race with copy construction on another thread. Give threads A and B
The text was updated successfully, but these errors were encountered: