50ns is approximately the cost of a cross-CPU L2 cache miss. Any time you
have tight cross-CPU communication, you're going to incur that cost no
matter how the communication is performed — whether it's via a sync.Mutex,
a channel, or an atomic write.
The way to eliminate that cost is to elimina
Robert
I was interested in channel peformance only because it's the 'go idiom'.
Channel communication is relatively complex, and so is a useful upper limit
to costs of inter-goroutine synchronisation.
It's reassuring to see that 50nsec per operation is what my machinery
delivers. Simpler operat
Channels are built with locks which without biased locking can lead to delays
as routines are scheduled / blocked under -especially under contention.
github.com/robaho/go-concurrency-test might illuminate some other options to
try.
> On Jan 18, 2021, at 8:13 PM, Pete Wilson wrote:
>
> No n
No need to beg forgiveness.
For me, the issue is the synchronisation, not how the collection is specified.
You’re right; there’s no reason why a slice (or an array) couldn’t be used to
define the collection. In fact, that’s the plan.
But the synchronisation is still a pain.
FWIW I built a channe