Skip to content

Conversation

fregie
Copy link
Contributor

@fregie fregie commented May 27, 2021

减少了statistic.memory中锁的使用,使用sync.Map和atomic包实现。
另外改用time.Ticker,可以减小一点带宽计算的误差。
@Loyalsoldier

@fregie
Copy link
Contributor Author

fregie commented May 28, 2021

顺便修复了所有data race的情况。

@fregie fregie mentioned this pull request May 30, 2021
@Loyalsoldier Loyalsoldier changed the title Chore: reduce lock in statistic.memory Chore: reduce lock May 31, 2021
@Loyalsoldier Loyalsoldier merged commit 6cafb1c into p4gefau1t:master May 31, 2021
@Loyalsoldier
Copy link
Collaborator

BTW,测试 TestMemoryAuth 在 macOS 总是失败,知道是什么原因吗?

@fregie fregie deleted the memory branch June 2, 2021 09:32
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