golang/go

net: clarify net.Conn concurrency requirement

Open

#27,203 opened on Aug 24, 2018

View on GitHub
 (17 comments) (2 reactions) (0 assignees)Go (19,008 forks)batch import
DocumentationNeedsInvestigationTestinghelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

From the net.Conn docs:

Multiple goroutines may invoke methods on a Conn simultaneously.

I'm not sure if this should be interpreted as different methods can be called concurrently, or as the same method can be called concurrently.

I suspect, judging from x/net/nettest's ConcurrentMethods and from most implementations, that it's the former. If so, should we change the docs to include "may invoke distinct methods"?

Contributor guide