golang/go

net: clarify net.Conn concurrency requirement

Open

#27.203 aperta il 24 ago 2018

Vedi su GitHub
 (17 commenti) (2 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationNeedsInvestigationTestinghelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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"?

Guida contributor