08 2018 档案
摘要:如果操作的数据命中同一条会出现互斥等待的情况: 1. 首先 begin 开始事务 2. 然后修改一条数据: update push_commit_info set commit_id="" where id=292; 3. 在新打开的窗口操作这条数据: 这时候数据出现等待情况:
阅读全文
摘要:长时间来一直以为在读多写少的场景下,读写锁性能必然优于互斥锁,然而情况恰恰相反 不废话了,先上一段测试代码 go run test_rwmutex_mutex.go rwmutex cost: 22.403487195s mutex cost: 21.636404963s go run test_r
阅读全文

浙公网安备 33010602011771号