One other note, I think passing the context around is very limited compared to 
TLS based usage. In well written frameworks the context is provided by and 
controlled by the container allowing for very advanced AOP style injections 
where appropriate (logging, security, transactions, etc)

Having direct control over the context seems like asking for brittle code and 
more obscure bugs (e.g. some method call replaces the context as they call the 
next). 

> On Jan 16, 2019, at 9:00 AM, Ian Lance Taylor <i...@golang.org> wrote:
> 
>> On Wed, Jan 16, 2019 at 5:39 AM Robert Engels <reng...@ix.netcom.com> wrote:
>> 
>> A big difference of opinion here.  TLS as implemented in Java via 
>> ThreadLocal is trivial to use, understand, and is pervasive. In C++ its a 
>> different story.
> 
> A general form of TLS is much more confusing in a language where it's
> trivial to start a goroutine.  To be at all useful we have to start
> talking about how and when goroutines inherit TLS values from their
> parent goroutine.  Then we need to control that.  It's a pile of
> complexity we don't need.  Better to be explicit.  In my opinion.
> 
> Ian

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