Re: [go-nuts] Support for the race detector on ARM

2017-02-27 Thread 'Dmitry Vyukov' via golang-nuts
On Tue, Feb 28, 2017 at 2:44 AM, Owen Waller wrote: > Why are 64-bit atomic load and stores required? To take an example. ARM6 > cores have have load stores for a very long time[1]. But being a 32-bit core > that's usually attached to a 32 bit memory bus, the instructions are

Re: [go-nuts] Extra bytes in Gob format

2017-02-27 Thread Rob Pike
For a single object, not a struct, it still gets sent as a struct with one field. The 0 is the marker after the last (only) field is sent. -rob On Mon, Feb 27, 2017 at 10:53 PM, Sam Whited wrote: > Hi all, > > I'm writing an implementation of the Gob serialization format

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-27 Thread Ayan George
On 02/27/2017 10:25 PM, Dan Kortschak wrote: > When the python functions are actually called the comparison is more > reasonable: > > ``` > ~/concat $ go test -bench . concat_test.go > BenchmarkUnicodeConcat-820 10379 ns/op > PASS > okcommand-line-arguments 2.193s

[go-nuts] Extra bytes in Gob format

2017-02-27 Thread Sam Whited
Hi all, I'm writing an implementation of the Gob serialization format in another language, but am seeing some extra bytes that, as far as I can tell, aren't described in the documentation. For example, if I encode a simple bool (https://play.golang.org/p/shFJnM3WgM) I get: > 03 02 00 01 I

[go-nuts] why there is pointer as there are slice already?

2017-02-27 Thread Tamás Gulácsi
No. It violates common sense: don't hide simple operations behind new characters, just to save three characters. -- 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

[go-nuts] why there is pointer as there are slice already?

2017-02-27 Thread hui zhang
why there is pointer as there are slice already? Can we remove pointer ? any where there is a pointer could be replaced with slice. func ptrfunc(p *int) { *p = 1 } func slicefunc(p []int) { p[0] = 1 } and we can defined a shortcut operator like ~ p[0].foo = p~foo does

[go-nuts] How to test os/exec functions

2017-02-27 Thread tanya - cube
How to mock exec.Command in Go -- 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

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-27 Thread Dan Kortschak
When the python functions are actually called the comparison is more reasonable: ``` ~/concat $ go test -bench . concat_test.go  BenchmarkUnicodeConcat-8      20 10379 ns/op PASS ok  command-line-arguments 2.193s ~/concat $ python concat_test.py  time_taken = 8901.3030529

[go-nuts] Re: reflect.ValueOf thread safety

2017-02-27 Thread Gabriel Adumitrachioaiei
Thanks a lot Dave, I thought that it would be safe but I chose the safe side, and coded as if it is not thread safe. On Monday, February 27, 2017 at 7:34:33 PM UTC, Dave Cheney wrote: > > No, that's is not thread safe. The race detector will spot that. -- You received this message because you

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-27 Thread Ian Lance Taylor
On Mon, Feb 27, 2017 at 6:40 PM, Shubha Ramani wrote: > mysetup is being called here: > > times = timeit.Timer(stmt="from __main__ import > concat",setup="gc.enable();from __main__ import mysetup").repeat(7,loops) > > Look at "from __main__ import mysetup" after

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-27 Thread Shubha Ramani
mysetup is being called here: times = timeit.Timer(stmt="from __main__ import concat",setup="gc.enable();from __main__ import mysetup").repeat(7,loops) Look at "from __main__ import mysetup" after gc.enable(); gc,enable() according to timeit rules needs to be called before the setup function.

Re: [go-nuts] Reflection Conundrum

2017-02-27 Thread Rolando Gonzalez Hernandez
My idea was to change the struct tag i.e. "xml:\"confidentialAccess,omitempty\"" to "xml:\"-\"" so that when there is no value so the nested struct the XML marshalling process doesn't generate the xml tags. So in short my idea is to use the ChangeTags function to change the struct tag to

[go-nuts] Re: File organization in a github-ed Go project

2017-02-27 Thread brainman
> if someone wants to fork my github project, he would have change my username bstarynk/ by his own one in every package path When I contribute to other people's projects on Gitub, I just "go get" their package, and adjust my "git remote" settings for the package so can push all my changes

Re: [go-nuts] Reflection Conundrum

2017-02-27 Thread Ian Lance Taylor
On Mon, Feb 27, 2017 at 4:41 PM, Rolando Gonzalez Hernandez wrote: > I've been dealing with a lot of structs to parse and convert XML to JSON and > viceversa. My main problem with this method is that some of the structures > have nested structures like this, for example: > >

Re: [go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-27 Thread Ayan George
On 02/27/2017 07:21 PM, Ian Lance Taylor wrote: > On Mon, Feb 27, 2017 at 3:58 PM, Shubha Ramani > wrote: >> Please see the attached two scripts. >> >> Use python3 for concat_test.py. >> >> I'm getting 591 nsec for the micro benchmark in python and 4453 ns >> for the

[go-nuts] Some best practices for debuging and optimizing with -gcflags?

2017-02-27 Thread jamalsmith95 . bc
What are some best practices for general purpose -gcflags to use for debugging and conversely for optimizing code? -- 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

[go-nuts] Why is Go Unicode concat so slow compared to Python3 ?

2017-02-27 Thread Shubha Ramani
Please see the attached two scripts. Use python3 for concat_test.py. I'm getting 591 nsec for the micro benchmark in python and 4453 ns for the microbenchmark in go. I stole this benchmark from Unicode.py of pybench, but changed it a bit. (py36env) shubha@shubha-Z170X-UD5:~/myperformance$ go

Re: [go-nuts] Support for the race detector on ARM

2017-02-27 Thread Owen Waller
> > > > Why are 64-bit atomic load and stores required? To take an example. ARM6 > > > > cores have have load stores for a very long time[1]. But being a 32-bit core > > > > that's usually attached to a 32 bit memory bus, the instructions are 32-bit. > > > > So is it just that an atomic pair of

[go-nuts] Re: How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Glen Newton
Thanks! :-) On Monday, February 27, 2017 at 4:45:19 PM UTC-5, Glen Newton wrote: > > > > Given a byte b, how do I convert it to a byte of particular endianness? > It is not clear to me looking at "encoding/binary" > > (I am assuming that golang byte endianness varies across architectures. > If

Re: [go-nuts] Re: How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Wim Lewis
On Feb 27, 2017, at 1:54 PM, Glen Newton wrote: > Ack! Sorry. > > I was referring to bit endianness https://en.wikipedia.org/wiki/Bit_numbering I think the golang package only deals with byte-oriented interfaces. Most CPUs can't address units smaller than a byte anyway,

[go-nuts] Re: How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Glen Newton
Ah, I've been thinking about this issue too much and have confused myself. And, I have expressed it as an XY Problem! :-( My real question should have been: if I write a byte to a file on one architecture, will the byte be the same on all other architectures (i.e. 386, amd64, arm, s390x,

[go-nuts] Re: How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Glen Newton
Ack! Sorry. I was referring to *bit endianness* https://en.wikipedia.org/wiki/Bit_numbering On Monday, February 27, 2017 at 4:45:19 PM UTC-5, Glen Newton wrote: > > > > Given a byte b, how do I convert it to a byte of particular endianness? > It is not clear to me looking at "encoding/binary" >

Re: [go-nuts] How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Ayan George
On 02/27/2017 04:45 PM, Glen Newton wrote: > > > |Given a byte b, how do I convert it to a byte of particular > endianness? It is not clear to me looking at ||"encoding/binary" > > (I am assuming that golang byte endianness varies across > ||architectures. If this is wrong please educate me).

Re: [go-nuts] How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Caleb Spare
What do you mean by the endianness of a single byte? Endianness is about the order of a sequence of bytes. On Mon, Feb 27, 2017 at 1:45 PM, Glen Newton wrote: > > > Given a byte b, how do I convert it to a byte of particular endianness? > It is not clear to me looking at

[go-nuts] How do I convert a byte into BigEndian or LittleEndian?

2017-02-27 Thread Glen Newton
Given a byte b, how do I convert it to a byte of particular endianness? It is not clear to me looking at "encoding/binary" (I am assuming that golang byte endianness varies across architectures. If this is wrong please educate me). :-) Thanks, Glen -- You received this message because you

Re: [go-nuts] Re: Casting []byte to []uint64

2017-02-27 Thread Bill Katz
Ah, of course, silly me conflating alignment with allocation size. Thanks for the suggestion. Best, Bill On Monday, February 27, 2017 at 3:35:32 PM UTC-5, Ian Lance Taylor wrote: > > On Mon, Feb 27, 2017 at 11:57 AM, Bill Katz > wrote: > > I thought that's handled by the

Re: [go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Jesper Louis Andersen
On Mon, Feb 27, 2017 at 8:51 PM Mark wrote: > It was my own fault:-( > On the other hand, it was great that you found it! Your intuition was right as well: something was amiss. Science happens whenever something is figured out :) -- You received this message because you

[go-nuts] Re: Casting []byte to []uint64

2017-02-27 Thread Bill Katz
I thought that's handled by the inhdr.Cap % 8 == 0 check. Isn't inhdr.Data essentially a pointer into memory with inhdr.Cap showing the size of the allocated region? On Monday, February 27, 2017 at 2:14:46 PM UTC-5, xingtao zhao wrote: > > I think you need to check if inhdr.Data is aligned

[go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Mark
It was my own fault:-( I'm now almost maxing out the CPUs. Basically, I'd created some goroutines to do work but forgot to call 'go' at one stage of my pipeline so that blocked. On Monday, February 27, 2017 at 7:20:48 PM UTC, Guillermo Estrada wrote: > > Yeah it probably is, even while creating

[go-nuts] reflect.ValueOf thread safety

2017-02-27 Thread Dave Cheney
No, that's is not thread safe. The race detector will spot that. -- 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

[go-nuts] Re: Casting []byte to []uint64

2017-02-27 Thread xingtao zhao
I think you need to check if inhdr.Data is aligned with 8 bytes as well. On Sunday, February 26, 2017 at 2:54:00 PM UTC-8, Bill Katz wrote: > > Hi, > > We'd like to do a zero-copy conversion of []byte to []uint64 where the > underlying memory for the byte slice is properly aligned for N uint64

[go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Mark
Yes, in VirtualBox on this machine I have Processors set to 4 and the Execution Cap set to 100% (i.e., no limit). I've also tried it on a real Windows 7 machine which has 2 cores & that only uses 1 thread and I've tried it on another VirtualBox, again it only uses 1 thread. I've now tried the

[go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Guillermo Estrada
Yeah it probably is, even while creating a lot of Goroutines, if your code spends too much time allocating memory and such, it won't be reflected in the CPU usage. Anyway, for what it's worth you can always check all that at runtime if you run into doubts again. https://golang.org/pkg/runtime/

Re: [go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Jesper Louis Andersen
Also, to plug a possible hole: what is the parallelism[0] of your solution? It might be that the coded solution is built such that only one goroutine can run at any time. Thus, the critical path (the span) through the program can only ever utilize a single core out of the 4 possible. You also

[go-nuts] Re: [Newbie] Create PNG from 2D Array and Write Over HTTP

2017-02-27 Thread Guillermo Estrada
Hi, first I would avoid using 2D arrays for storing pixels and such, that's not even a Go thing, (although Go internal library uses a 1D array for storing pixels of images), even in C or C++ a 1D array is recomended, it is faster to say the least and more efficient. img[x][y] becomes

[go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Guillermo Estrada
Are you sure your virtual machine has 4 cores assigned? You might have 4 cores, but when you create the VM you can assign any number of cores to it (1 being default IIRC). On Monday, February 27, 2017 at 12:39:31 PM UTC-6, Mark wrote: > > I just tried this on an old Windows 7-32bit machine

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread Guillermo Estrada
Thanks! I guess I missed them cause of the ordering variables being on the very top and ByteOrder interface being the last. I knew there had to be a way and I was missing something. On Monday, February 27, 2017 at 12:51:08 PM UTC-6, howar...@gmail.com wrote: > > Look a little further down -

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread Guillermo Estrada
On Monday, February 27, 2017 at 12:48:53 PM UTC-6, howar...@gmail.com wrote: > > You are missing that it is encoding. Specifically, using VarInt is asking > for Variable integer encoding: > https://developers.google.com/protocol-buffers/docs/encoding#varints > > The important bit here is that

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
Oh, and make wcMax of 0 produce default of max (otherwise it doesn't make sense to have 0 chars?) https://play.golang.org/p/2rLtWFGhpW On Monday, February 27, 2017 at 6:41:50 PM UTC, Mark wrote: > > One tiny suggestion s[:i] > > https://play.golang.org/p/_T_hqBg6ka > > Thanks:-) > > On Monday,

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread Guillermo Estrada
Thanks a lot! This works as expected, I think functions for BigEndian and LittleEndian should be documented or at least referenced in the binary documentation. import ( "encoding/binary" "fmt" "time" ) func main() { t := time.Now() b1 := make([]byte, 8) b2 := make([]byte, 8)

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread howardcshaw
Look a little further down - they are documented in the ByteOrder type. A ByteOrder specifies how to convert byte sequences into 16-, 32-, or 64-bit unsigned integers. type ByteOrder interface { Uint16([]byte ) uint16

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread howardcshaw
You are missing that it is encoding. Specifically, using VarInt is asking for Variable integer encoding: https://developers.google.com/protocol-buffers/docs/encoding#varints The important bit here is that the Varint stores 7-bits of data and 1-bit of metadata in each byte (the metadata being

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread Guillermo Estrada
On Monday, February 27, 2017 at 12:41:43 PM UTC-6, zeebo wrote: > > You're using the variable width encoding. The number of bytes of a > variable width encoded int64 will depend on the magnitude of the value. If > you use binary.BigEndian or binary.LittleEndian you can use the > *PutUint64*

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
One tiny suggestion s[:i] https://play.golang.org/p/_T_hqBg6ka Thanks:-) On Monday, February 27, 2017 at 6:36:06 PM UTC, peterGo wrote: > > Mark, > > Fixed typos and made minor improvements. > > Go Playground: https://play.golang.org/p/cbQL8-72s5 > > Peter > > On Monday, February 27, 2017 at

[go-nuts] Re: int64 -> []byte writing 9 bytes?

2017-02-27 Thread zeebo
You're using the variable width encoding. The number of bytes of a variable width encoded int64 will depend on the magnitude of the value. If you use binary.BigEndian or binary.LittleEndian you can use the PutUint64 method which will always be 8 bytes. On Monday, February 27, 2017 at 11:27:07

Re: [go-nuts] int64 -> []byte writing 9 bytes?

2017-02-27 Thread Rob Pike
Varints (the name is short for variable-sized int encodings) are not fixed-size, and it takes 9 bytes to encode 64 bits of information as there is some overhead. I suspect you want Uint64 not Varint for this code. -rob On Mon, Feb 27, 2017 at 10:27 AM, Guillermo Estrada

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
Peter, I compared your version with mine on plenty of sample data & they produced the same results. Although my version seems to do more copying, the difference between them was += 0.01 sec on each run. However, yours is simpler and clearer than mine, so I'm now using yours:-) Thank you! On

[go-nuts] int64 -> []byte writing 9 bytes?

2017-02-27 Thread Guillermo Estrada
Hey Gophers! I'm having a bit of trouble understanding something about the standard library, I'm pretty sure either it is not wrong, or there is a reason behind it, but either way I don't understand which one. As the title suggests, I'm using encode/binary to write a int64 into a byte slice,

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread peterGo
Mark, For example, Go Playground: https://play.golang.org/p/dv48PLY-CD Peter On Monday, February 27, 2017 at 11:05:32 AM UTC-5, Mark wrote: > > Ooops just realised that I didn't enforce the max chars limit. Here's > another version: > > func CwcharToString(p uintptr, maxchars int) string { >

[go-nuts] Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Mark
I have a Go app that only uses 1 thread when GOMAXPROCS is 4 on Windows 7-64bit inside VirtualBox even though I can have up to 20 goroutines. Is this a known problem? And is there a solution that can force Go to use all 4 CPUs? (The underlying hardware is a 64-bit i7.) Thanks. -- You received

[go-nuts] Re: [Newbie] Create PNG from 2D Array and Write Over HTTP

2017-02-27 Thread howardcshaw
You could define the colors higher in the package - right now you are allocating them every time, but they are not changing. You could also also retain the image and simply wipe and rewrite it every time as long as it is not happening in a goroutine in multiple places - if so, you could retain

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
Ooops just realised that I didn't enforce the max chars limit. Here's another version: func CwcharToString(p uintptr, maxchars int) string { if p == 0 { return "" } uints := make([]uint16, 0, maxchars) for i, p := 0, uintptr(unsafe.Pointer(p)); i < maxchars; p += 2 {

Re: [go-nuts] Monotonic clock: is my code affected?

2017-02-27 Thread Caleb Spare
I don't think the behavior of that code changes. (t.Hour, etc operate on wall time; t.Add operates on both wall and monotonic time.) If I wanted to truncate times to hours, though, I would write code like this: https://play.golang.org/p/el8hUeXpWK On Mon, Feb 27, 2017 at 3:25 AM, Olivier Mengué

[go-nuts] correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
In a Windows DLL that I'm accessing from Go one of the functions returns a wchar_t* containing some text. This comes back as a uintptr in r1. Here's my conversion function -- is it reasonable? func CwcharToString(p uintptr) string { if p == 0 { return "" } uints :=

[go-nuts] Monotonic clock: is my code affected?

2017-02-27 Thread Olivier Mengué
Hi, I wrote a library that allows to compute the hour/day/week/month/year bounds in the location of a given time.Time value. This deals with wall clock, not monotonic clock. I just read the monotonic clock proposal at https://github.com/golang/proposal/blob/master/design/12914-monotonic.md I

[go-nuts] [Newbie] Create PNG from 2D Array and Write Over HTTP

2017-02-27 Thread maaattss
Hi, I'm just starting to learn Go. I have a small pattern in a 5x5 array of bools. I turn this into an image by looping through all of the values in the array and using Image.Set if the value is true. matrix := [5][5]bool{} // fill in matrix here m := image.NewRGBA(image.Rect(0, 0, 5, 5)) fg

[go-nuts] Calling functions in a Windows DLL from Go

2017-02-27 Thread Mark
I've used syscall.MustLoadDLL to load a DLL and MustFindProc to get *syscall.Procs to the functions I need. However, I can't find the info I need in the docs (if it is there a link would be great!) If a DLL function returns an int >=0 in r1 do I need to cast this to a uintptr or can I just

Re: [go-nuts] Put the CancelFunc inside Context

2017-02-27 Thread dc0d
I was about to make a PR but saw in the tests that context is already being used as a closure and since I've been both wrong and do not have a convincing reasoning for this change, it seems things are working fine. On Monday, February 27, 2017 at 5:59:55 PM UTC+3:30, dc0d wrote: > > According

Re: [go-nuts] File organization in a github-ed Go project

2017-02-27 Thread Dave MacFarlane
If someone wanted to fork your library for one of their programs, they could also vendor the package with their changes until it's changed significantly enough that they think it's worth updating to its own namespace (and at that point, it really should be a different import path..) On Mon, Feb

Re: [go-nuts] Put the CancelFunc inside Context

2017-02-27 Thread dc0d
According to the docs "Wait blocks until all function calls from the Go method have returned, then returns the first non-nil error (if any) from them"; it doesn't say if I cancel the original context what will happen. The parent/child pattern for using contexts (a hierarchy of contexts) is not

[go-nuts] Re: File organization in a github-ed Go project

2017-02-27 Thread Basile Starynkevitch
On Monday, February 27, 2017 at 3:02:24 PM UTC+1, C Banning wrote: > > Try organizing your project as: > > monimelt > > src > > cmd (or "monimelt", if there's just one app) > > objvalmo > > serial > > > > Then include $HOME/monimelt in your GOPATH. > >> >> Thanks for the suggestion. BTW,

[go-nuts] Re: File organization in a github-ed Go project

2017-02-27 Thread C Banning
Try organizing your project as: monimelt src cmd (or "monimelt", if there's just one app) objvalmo serial Then include $HOME/monimelt in your GOPATH. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

[go-nuts] go/pointer: query element of tuple with no corresponding *ssa.Extract in the program

2017-02-27 Thread dominik
Let's say I have the following function: func main(): 0:entry P:0 S:0 t0 = *os.Stdout*os.File t1 = make io.Writer <- *os.File (t0) io.Writer t2 =

Re: [go-nuts] Put the CancelFunc inside Context

2017-02-27 Thread Ian Davis
On Mon, 27 Feb 2017, at 11:39 AM, dc0d wrote: > Is there any drawbacks if we put the CancelFunc of a cancellable > context.Context inside it's values? > > Problem: I needed a cross breed of WaitGroup and Context. So a > WaitGroup and it's CancelFunc is put inside it's values and are used >

Re: [go-nuts] anything much faster container.List

2017-02-27 Thread Oleg Puchinin
Ok ! Thank you ! Oleg. 2017-02-27 19:13 GMT+06:00 Caleb Doxsey : > Hi Oleg, > > Use an unrolled list: https://en.wikipedia.org/wiki/Unrolled_linked_list > > In computer programming, an unrolled linked list is a variation on the >> linked list which stores multiple elements in

Re: [go-nuts] anything much faster container.List

2017-02-27 Thread Caleb Doxsey
Hi Oleg, Use an unrolled list: https://en.wikipedia.org/wiki/Unrolled_linked_list In computer programming, an unrolled linked list is a variation on the > linked list which stores multiple elements in each node. It can > dramatically increase cache performance, while decreasing the memory >

[go-nuts] anything much faster container.List

2017-02-27 Thread Oleg Puchinin
Hello ! I have a million strings. The ever-expanding array is not for me. The element on the line, too, is not it. Is there anything more powerful c ontainer.List? Oleg. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] reflect.ValueOf thread safety

2017-02-27 Thread Gabriel Adumitrachioaiei
I wanted to ask if using reflect.ValueOf concurrently with some other code that makes changes in the memory the pointer references, is thread safe ? For example: type Test struct { name string } var x = {name: "test"} go func() {

Re: [go-nuts] Re: weak hash for (MongoDb like) data server

2017-02-27 Thread Basile Starynkevitch
On Thursday, February 16, 2017 at 9:11:08 PM UTC+1, Ian Lance Taylor wrote: > identified one approach using finalizers. That approach will work > today as Go's garbage collector never moves items. > Thanks Ian for your help. FWIW, I just have coded this objvalmo.go file and function

[go-nuts] Put the CancelFunc inside Context

2017-02-27 Thread dc0d
Is there any drawbacks if we put the CancelFunc of a cancellable context.Context inside it's values? Problem: I needed a cross breed of WaitGroup and Context. So a WaitGroup and it's CancelFunc is put inside it's values and are used with some helper functions. I wrote a variant of WaitGroup -

Re: [go-nuts] Support for the race detector on ARM

2017-02-27 Thread 'Dmitry Vyukov' via golang-nuts
On Fri, Feb 24, 2017 at 11:24 PM, Owen Waller wrote: > Hi Dimitry, > > ThreadSanitizer does not work on any 32-bit platforms. It assumes that > it can reserve huge continuous chunks of address space for various > things. > > > > > Tsan reserves 4X for shadow memory (where X is

[go-nuts] can I use go develop ios lib?

2017-02-27 Thread hui zhang
I want to use go to develop a lib for both ios and android. It seems ok for android. How about ios? I know there is a project called *gomobile*. However ,after research I am not going to depend on that. I just use it in original go. Use golang to build dynamic library .so , and embedded it