3 ms·
You could use the atomic package and forego the lock. You can also have a go routine with a channel that receives the counter messages. No need for a lock ther
by jamra 6y ago
You could use the atomic package and forego the lock. You can also have a go routine with a channel that receives the counter messages. No need for a lock there.
But use it if you really need it. Likely that’s not your bottleneck.