I have set channel buffer size to zero, like var intChannelZero = make(chan int)
, when getting value from the intChannelZero
will be blocked until the intChannelZero
has value.
Also, I set channel buffer size to one, like var intChannelOne = make(chan int, 1)
, when getting value from the intChannelOne
will be blocked until the intChannelOne
has value.
We know the capacity of intChannelZero
is zero, the capacity of intChannelOne
is one, so I want to know:
- When putting a value to the
intChannelZero
likeintChannelZero <- 1
, where the value be saved? - The differences between
intChannelZero
andintChannelOne
when putting a value to them.
Who can explain it at the level of Golang Runtime Enviroment? Thanks a lot.