elliotchance / orderedmap

🔃 An ordered map in Go with amortized O(1) for Set, Get, Delete and Len.
MIT License
817 stars 62 forks source link

feat: Concurrent safety for ordered maps #35

Open otaxhu opened 8 months ago

otaxhu commented 8 months ago

Using v2.

I saw in the source code that there is a lot of critical sections where race conditions can happen, this can be a feature that doesn't change the current API, more like a internal feature.

Have a great day.

elliotchance commented 8 months ago

That's by design, it doesn't promise to be safe for concurrent operations. Applications will have to provide locking in the way that makes sense for their respective use cases.