4 ms·
Yeah, I don't mean buffered data. I mean blocked queueing operations. >With multiple receivers it is effectively random _which_ receiver gets the wakeup. That
by Groxx 2y ago
Yeah, I don't mean buffered data. I mean blocked queueing operations.
>With multiple receivers it is effectively random _which_ receiver gets the wakeup.
That's why I brought it up: no it isn't. It's ordered. Intentionally.
https://github.com/golang/go/issues/11506 https://github.com/golang/go/issues/11506
It's pretty easy to prove to yourself too, it only takes a couple dozen lines to write a test. I'm not confident it's guaranteed in all scenarios (mutexes are not, for example), but I've yet to see it do anything but perfect FIFO when not racing on starting both read and write simultaneously.
---
A single select statement with multiple eligible channel operations is random, which is part of why I expected blocked channel operations themselves to be random. But nope.