I am guessing the same efficiency should be possible. Except, each call to 
a chained Transform
would involve a couple of allocations (to create the state). On the good 
side, this simplifies concurrent
code sharing the same object (no locks), avoids the original problem 
(concurrency corruption) and avoid
having to create multiple instances of the same chain if one is to avoid 
locks (saves allocations here).

 

> The general rule for the standard library is that if a type does not 
> explicitly say that it is safe to call methods from multiple 
> goroutines, then it is not safe to do so.  That said, it may be 
> reasonable to explicitly state that in this case.
>

I agree, but consider the Forms used in my example above, they are 
thread-safe as they are package level
values.
 

>
> I don't think it should be made thread-safe unless the result is just 
> as efficient.  Efficiency matters here. 
>
> Ian 
>


Then I guess it is worth the try? I will have a proposal this weekend.

Regards

Bryan 

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