美文网首页
Tips of Golang Sync

Tips of Golang Sync

作者: forks1990 | 来源:发表于2019-03-12 22:20 被阅读0次

If a cache requires heavy computation or must be done once, use singleflight: https://godoc.org/golang.org/x/sync/singleflight

If multiple goroutine requests the same item, only send one request, other goroutine blocked and the same result returned.

相关文章

网友评论

      本文标题:Tips of Golang Sync

      本文链接:https://www.haomeiwen.com/subject/uqgopqtx.html