3 ms·
> Queues ("channels") are a good way to limit complexity of threaded code by treating each process as an agent. Besides some syntactical sugar Go doesn't really
by skj 11y ago
> Queues ("channels") are a good way to limit complexity of threaded code by treating each process as an agent. Besides some syntactical sugar Go doesn't really support this better than most other languages with threading, like Java.
The magic of channels comes with select{}. Considering them to be only threadsafe queues is really missing out.
Supporting select{} in other languages is possible, but difficult and rare.
- bmurphy1976 11y agoAlso, by default channels are zero length and block. What is a zero length queue in other languages? Doesn't even make sense! Zero length channels are a key part of coordinating concurrent threads in Go.