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

fix:current writes map #182

Merged
merged 1 commit into from
Aug 12, 2023
Merged

fix:current writes map #182

merged 1 commit into from
Aug 12, 2023

Conversation

MrGlp
Copy link
Contributor

@MrGlp MrGlp commented Aug 11, 2023

Hello, monkeyWie, I'm dc

The modifications regarding #176 have been completed.

Using sync.Map would modify the important data structure of Download. The methods involve numerous load operations that require parameters of type any. Retrieving data also requires type checking of the load result, making the code rather cumbersome.

Considering that our primary focus is on the client-side program, simply using sync.RWMutex for locking is sufficient. Even if the server-side is involved, the download methods won't exhibit significant concurrency, and the locking scope is limited to the single write operation of storing data in the map. Therefore, the changes are straightforward.

Lately, I've been studying more about P2P-related aspects. In the upcoming time, I will be making more submissions regarding issues and features within the project. Join to project, thanks.

@monkeyWie
Copy link
Member

It seems good, thank for your PR~

@monkeyWie monkeyWie merged commit e63cfca into GopeedLab:main Aug 12, 2023
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.

2 participants