Ah I see. You mean its obvious that multiple goroutines may invoke methods 
on a Conn simultaneously, your question is whether its safe or not, which 
the docs do not answer.

The docs definitely intend on meaning that it is in fact safe to invoke 
methods on a Conn simultaneously.

But I agree, the docs could be clarified. I think it would be best to open 
an issue on GitHub regarding this.

On Monday, December 18, 2017 at 9:48:09 AM UTC-5, Anmol Sethi wrote:
>
> Not sure where what is prompting your question, how are the docs 
> misleading? The docs are very clear, net.Conn is concurrency safe.
>
> On Monday, December 18, 2017 at 7:51:26 AM UTC-5, SP wrote:
>>
>> In the documentation for https://golang.org/pkg/net/#Conn, it's stated 
>> that 
>>
>> Multiple goroutines may invoke methods on a Conn simultaneously.
>>
>> My guess is this is not meant to imply that it is necessarily safe to do 
>> so. For instance, calls to Set*Deadline may create race conditions between 
>> goroutines. However, if this is true it also makes the quoted claim 
>> pointlessly self-evident.
>>
>> Am I missing something or is the documentation somewhat misleading here? 
>> You could argue (and it would be perfectly fair) that programmers should be 
>> aware of these sorts of obvious concurrency problems, but the misleading 
>> nature of the documentation has me questioning whether I can trust it at 
>> all.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to