filmov
tv
Golang Buffered channel vs Unbuffered channel && NoTalk

Показать описание
An unbuffered channel has no capacity to store values that are sent to it. When a value is sent to an unbuffered channel, the send operation blocks until another goroutine receives from the channel. Similarly, when a value is received from an unbuffered channel, the receive operation blocks until another goroutine sends a value to the channel.
A buffered channel has a capacity to store one or more values that are sent to it. When a value is sent to a buffered channel, the send operation does not block if there is free capacity in the channel. Similarly, a receive operation does not block if there are values in the channel.
A buffered channel has a capacity to store one or more values that are sent to it. When a value is sent to a buffered channel, the send operation does not block if there is free capacity in the channel. Similarly, a receive operation does not block if there are values in the channel.