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

syncs: add Map #6260

Merged
merged 1 commit into from Nov 10, 2022
Merged

syncs: add Map #6260

merged 1 commit into from Nov 10, 2022

Conversation

dsnet
Copy link
Member

@dsnet dsnet commented Nov 10, 2022

Map is a concurrent safe map that is a trivial wrapper over a Go map and a sync.RWMutex.

It is optimized for use-cases where the entries change often, which is the opposite use-case of what sync.Map is optimized for.

The API is patterned off of sync.Map, but made generic.

Signed-off-by: Joe Tsai joetsai@digital-static.net

@dsnet
Copy link
Member Author

dsnet commented Nov 10, 2022

\cc @soniaappasamy

syncs/syncs.go Outdated Show resolved Hide resolved
syncs/syncs.go Outdated Show resolved Hide resolved
syncs/syncs.go Show resolved Hide resolved
@dsnet dsnet force-pushed the dsnet/syncs-map branch 2 times, most recently from e24849e to bf9fcda Compare November 10, 2022 05:46
@soniaappasamy
Copy link
Member

Nice, thanks!

Map is a concurrent safe map that is a trivial wrapper
over a Go map and a sync.RWMutex.

It is optimized for use-cases where the entries change often,
which is the opposite use-case of what sync.Map is optimized for.

The API is patterned off of sync.Map, but made generic.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
@dsnet dsnet merged commit 9a05cdd into main Nov 10, 2022
@dsnet dsnet deleted the dsnet/syncs-map branch November 10, 2022 18:55
DentonGentry pushed a commit that referenced this pull request Nov 11, 2022
Map is a concurrent safe map that is a trivial wrapper
over a Go map and a sync.RWMutex.

It is optimized for use-cases where the entries change often,
which is the opposite use-case of what sync.Map is optimized for.

The API is patterned off of sync.Map, but made generic.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
DentonGentry pushed a commit that referenced this pull request Nov 15, 2022
Map is a concurrent safe map that is a trivial wrapper
over a Go map and a sync.RWMutex.

It is optimized for use-cases where the entries change often,
which is the opposite use-case of what sync.Map is optimized for.

The API is patterned off of sync.Map, but made generic.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
(cherry picked from commit a6b578a)
coadler pushed a commit to coder/tailscale that referenced this pull request Feb 2, 2023
Map is a concurrent safe map that is a trivial wrapper
over a Go map and a sync.RWMutex.

It is optimized for use-cases where the entries change often,
which is the opposite use-case of what sync.Map is optimized for.

The API is patterned off of sync.Map, but made generic.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
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.

None yet

3 participants