-
Notifications
You must be signed in to change notification settings - Fork 93
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: concurrent map operations #150
Conversation
if !updateTempStatus.CompareAndSwap(false, true) { 这个可以去掉了 |
当时加这个应该是想一次只跑一个,这个操作比较慢 可能会同时多个 goroutine 积压在一起 |
看你commit信息是修复可能的数据竞争
…On Sat, Jan 4, 2025 at 13:42 UUBulb ***@***.***> wrote:
if !updateTempStatus.CompareAndSwap(false, true) { return } defer
updateTempStatus.Store(false)
这个可以去掉了
当时加这个应该是想一次只跑一个,这个操作比较慢 可能会同时多个 goroutine 积压在一起
—
Reply to this email directly, view it on GitHub
<#150 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG7DUMMP452YQAJFRRI5JPL2I5YC5AVCNFSM6AAAAABUSX3JG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZQGE2DCNJUGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
应该跟那个不一样,那个是为了防止任务 goroutine 执行的 reportHost 与 reportState 的冲突,不过现在删了的话应该没必要了 |
@@ -55,7 +55,7 @@ func FetchIP(useIPv6CountryCode bool) *pb.GeoIP { | |||
if ipv6 != "" && (useIPv6CountryCode || ipv4 == "") { | |||
GeoQueryIPChanged = GeoQueryIP != ipv6 || GeoQueryIPChanged | |||
GeoQueryIP = ipv6 | |||
} else { | |||
} else if ipv4 != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样不会用到连接ip了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果自启动来就一直是空应该可以取到
这样会不会出现 40 -> 0 -> 40 -> 0 反复横跳 |
No description provided.