]> Cypherpunks repositories - gostls13.git/commit
netchan: do not block sends; implement flow control.
authorRoger Peppe <rogpeppe@gmail.com>
Wed, 19 Jan 2011 20:28:49 +0000 (12:28 -0800)
committerRob Pike <r@golang.org>
Wed, 19 Jan 2011 20:28:49 +0000 (12:28 -0800)
commit6fb1bf26aee2f68aaf15d7fc811d6ba7f4311a99
tree6e94dc204b08ebf5816519e9ab5645845ad2d5f8
parent89993544c2f9a188d0789e0c955c66093f6f5ba1
netchan: do not block sends; implement flow control.
When data is received for a channel, but that channel
is not ready to receive it, the central run() loop
is currently blocked, but this can lead to deadlock
and interference between independent channels.
This CL adds an explicit buffer size to netchan
channels (an API change) - the sender will not
send values until the buffer is non empty.

The protocol changes to send ids rather than channel names
because acks can still be sent after a channel is hung up,
we we need an identifier that can be ignored.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2447042
src/pkg/netchan/common.go
src/pkg/netchan/export.go
src/pkg/netchan/import.go
src/pkg/netchan/netchan_test.go