-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

System Programming Essentials with Go
By :

The main difference between buffered and unbuffered channels is the guarantee of delivery.
As we saw earlier, the unbuffered channels always guarantee delivery, since they only send a message when the receiver is ready. Conversely, the buffered channels can’t ensure message delivery because they can “buffer” an arbitrary number of messages before the synchronization step becomes mandatory. Therefore, the reader could fail to read a message from the channel buffer.
The most considerable side effect of choosing between them is how much latency you can afford to introduce to your program.
Latency in the context of concurrent programming refers to the time it takes for a piece of data to travel from a sender (goroutine) to a receiver (goroutine) through a channel.
In Go channels, latency is influenced by several factors: