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

Proposal: Add a concurrent-safe map to improve the concurrency security of the state management module #71

Closed
daniel-hutao opened this issue Dec 26, 2021 · 0 comments · Fixed by #70
Assignees
Labels
enhancement New feature or request refactor refactor

Comments

@daniel-hutao
Copy link
Member

Description

sync.Map is like a Go map[interface{}]interface{} but is safe for concurrent use by multiple goroutines without additional locking or coordination.

sync.Map is more reliable and efficient than default build-in Map + Mutex.

Describe the Proposal

  • Adding a ConcurrentMap type to package sync.Map & keyType & valueType
  • Change States to StatesMap, States & State are a bit confusing
  • Use ConcurrentMap with keyType string & valueType *State to redefine StatesMap
@daniel-hutao daniel-hutao added enhancement New feature or request refactor refactor labels Dec 26, 2021
@daniel-hutao daniel-hutao self-assigned this Dec 26, 2021
@daniel-hutao daniel-hutao linked a pull request Dec 26, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant