Skip to content
New issue

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

Use of a Read Write Mutex #20

Open
shashankmehra opened this issue Jun 27, 2019 · 0 comments
Open

Use of a Read Write Mutex #20

shashankmehra opened this issue Jun 27, 2019 · 0 comments

Comments

@shashankmehra
Copy link

I was wondering if this library supports concurrency, and saw that a recent commit seems to imply that the support has been added: 1ce4922

However, wouldn't your trie still be open to concurrent read operations while you have mutex locked Add or Remove. In that case, would it make sense to shift to sync.RWMutex.

Also to support custom concurrent walks, it would make sense to have GetChild(rune) *Node function instead of Children() map[rune]*Node. So that a read lock can be taken inside GetChild. Whereas, using Children() would allow the caller to easily ignore an internal mutex lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant