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

Storing references into sync.Maps after loading and editing that reference #2203

Open
Samyoul opened this issue Apr 15, 2021 · 1 comment
Open
Assignees

Comments

@Samyoul
Copy link
Member

Samyoul commented Apr 15, 2021

For a little context see the discussion here #2199 (comment)

I've introduced a lot of comments into the code base that read // TODO(samyoul) remove storing of an updated reference pointer?.

We've recently changed Messenger's use of maps to use custom sync.Maps and removed most usages of Messenger.mutex. While doing this I noticed that in a lot of cases we load a reference from a map and then perform some update on it and then save the reference back into the map.

In principle we are getting a reference from a map and updating the reference, then we give the reference back to the map, meaning we aren't updating the map's value and therefore don't need to store the reference back into the map.

We need to answer the question of what do we want to do?

  • Do we want to store something after updating a reference pointer?
    • If so why?
  • Do we want to remove all storing of updated references?
    • Are we happy without an explicit "update"?
@ghost
Copy link

ghost commented Aug 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants