Is Mutex+Chan Version of Once Better Than sync.Once?
In my previous blog packages.Load jitters, I said the jitters are caused by too many go routines are spawned so synchronization takes a lot of times.
However, at the beginning I thought the Lock
in sync.Once
costs a lot, so I tried to replace sync.Once
with Mutex
+Chan
. The result is the sync.Once
is still better.