Closed
Description
Background
sync.Map was useful enough to be promoted from /x/, but was made before generics and utilizes interface{}
(now any
)
Proposal
Re-implement the existing API of sync.Map using generics for added type safety/convenience. Use alternate struct name to maintain backward compatibility (e.g. sync.MapGeneric
)
Release
Release to /x/sync first while feedback is submitted.
Additional considerations
Proposal #47643 requested support for additional algorithms for additional use cases. We may want to allow the sync.Map's implementation algorithm to be user selectable. If so, I'd propose adding a method that can optionally be invoked on newly created sync.MapGeneric structs to specify the backing algorithm.
Separately
I volunteer to do the work.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
kf6nux commentedon Mar 31, 2022
Ah, I was just informed this is also being discussed here #48287
ianlancetaylor commentedon Mar 31, 2022
Thanks. See also #47657. Closing as dup.