Skip to content

Conversation

@dsymonds
Copy link

Go maps are not safe to mutate concurrent with other mutations or reads.

Go maps are not safe to mutate concurrent with other mutations or reads.
@grahamking
Copy link
Owner

Thanks! None of the version are thread safe, and I agree they should be. My tests never used more than one thread, so performance results shouldn't change. I'll merge this when I do the other two versions.

@jbarham
Copy link

jbarham commented Mar 21, 2012

Hah, you beat me to it. Here's another approach that wraps the cache map in a thread-safe container: https://github.com/jbarham/Key-Value-Polyglot/blob/master/memg.go

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

Successfully merging this pull request may close these issues.

4 participants