Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-23 Thread mpvl
On Tue, Jun 21, 2016 at 5:56 AM, Ian Lance Taylor wrote: > On Mon, Jun 20, 2016 at 5:57 PM, Bryan Reynaert wrote: > > > > the following code panics with: runtime error: slice bounds out of range > > > > > > var testTransform = transform.Chain(norm.NFD, norm.NFC) > > > > func main() { > > for i :

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-22 Thread Nigel Tao
+mpvl although my instinct is that this is all working as intended, and types are not goroutine-safe unless they explicitly say so. On Tue, Jun 21, 2016 at 2:33 PM, Ian Lance Taylor wrote: > On Mon, Jun 20, 2016 at 9:15 PM, wrote: >> I am guessing the same efficiency should be possible. Except

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 9:15 PM, wrote: > 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), avoid

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread alkemir
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) a

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 5:57 PM, Bryan Reynaert wrote: > > the following code panics with: runtime error: slice bounds out of range > > > var testTransform = transform.Chain(norm.NFD, norm.NFC) > > func main() { > for i := 0; i < 200; i++ { > go func() { > transform.String(testTransform, "nonempty