hashicorp / yamux

Golang connection multiplexing library
Mozilla Public License 2.0
2.24k stars 236 forks source link

docs: clarify the semantics of concurrent `Read` calls #136

Closed tgross closed 2 months ago

tgross commented 2 months ago

Concurrent operations on the stream are "safe" inasmuch as they don't cause a data race. That is, calling close concurrently with a read won't panic, you can write and read concurrently, and reading from two different goroutines shouldn't result in short reads. But there's no intended guarantee that the reads are semantically meaningful if you're reading concurrently.

Fixes: https://github.com/hashicorp/yamux/issues/128 Fixes: https://hashicorp.atlassian.net/browse/NET-10293