蛮荆

Recent content on 蛮荆

马上订阅 蛮荆 RSS 更新: https://dbwu.tech/index.xml

sync.Mutex Code Reading

2023年4月23日 08:00
互斥锁可以在两种模式下操作:正常模式和饥饿模式,正常模式的性能要好很多,因为 goroutine 可以连续多次获得互斥锁,即使存在阻塞的 goroutine, 与此同时,饥饿模式是防止尾部的 goroutine 被饿死的重要机制 (高尾延时)。