摘要: 需求 读写共享map #1 常规map package main import ( "fmt" "strconv" "sync" ) func _110Test1() { wg := sync.WaitGroup{} mp := make(map[string]int) for i := 0; i 阅读全文
posted @ 2022-02-09 09:52 jihite 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 不加锁 package main import ( "fmt" "sync" ) var x=0 var wg107 sync.WaitGroup func add1() { for i := 0; i < 50000; i++ { x += 1 } wg107.Done() } func test 阅读全文
posted @ 2022-02-09 09:23 jihite 阅读(84) 评论(0) 推荐(0) 编辑