[go-nuts] http Transport dies too slowly

2018-05-26 Thread Tamás Gulácsi
Just reuse the created http.Client. -- 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://grou

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-26 Thread Sokolov Yura
CAS with presence of transactions... Why? Badger had CAS before they added transactions. Since you use Badger, I hope your storage is also transactional. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

[go-nuts] Re: I am confused.

2018-05-26 Thread alex . rou . sg
Have you not seen my post about joining a chat server? Instead of waiting a day or so for each reply, people could reply instantly and hold your hand through setting things up. On Sunday, 27 May 2018 11:37:48 UTC+8, John wrote: > > Well I guess I would just use the Go playground so it is easier.

[go-nuts] Re: I am confused.

2018-05-26 Thread John
Well I guess I would just use the Go playground so it is easier. On Saturday, May 26, 2018 at 8:27:59 PM UTC-7, John wrote: > > I tried to find the terminal button but did not find it. And also I don't > know but does the welcome screen say welcome using or something. Because I > can't find the

[go-nuts] Re: I am confused.

2018-05-26 Thread John
I tried to find the terminal button but did not find it. And also I don't know but does the welcome screen say welcome using or something. Because I can't find the blue vertical line on the right. But to make matters worse Okay I confess: I am just a kid under 15, and me and my mom just mov

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread Hugh Fisher
On Sunday, May 27, 2018 at 1:22:58 AM UTC+10, Li Jianhua wrote: > > > > Will C++ do move more often and do copy less often with its specific move > semantics. C++ will do move whenever possible, right? > Perhaps. It's difficult to tell, because C++ is a horribly complicated language. Will C++

[go-nuts] My take on package management for Go2

2018-05-26 Thread 'meta keule' via golang-nuts
https://github.com/golang/go/issues/25588 Regards Benny -- 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 opti

[go-nuts] Re: Freeing memory of a cgo library

2018-05-26 Thread Liron Levy
Hey Jake, Yes, i will probably go with the first option :) feel a bit massy but it is probably the better way to go... Plus in my case probably the only way hahaha. Thanks a lot for helping. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To u

[go-nuts] http Transport dies too slowly

2018-05-26 Thread chuvak117
Hi, i have memory leaks cause http Transport dies too slowly. I'v creating Transports for checking proxy every 2 minute, so new Transports creates faster that old dies. Here i'm checking func checkProxySOCKS(prox string, c chan QR, wg *sync.WaitGroup) (err error) { defer wg.Done() di

[go-nuts] Re: Counting semaphore vs Workerpool

2018-05-26 Thread jake6502
So, it looks to me like 1 million URLS will spin up 1 million goroutines. That seems unnecessary, and likely to be a problem. I usually default to the simplest model, unless there is a reason to do otherwise. IMHO, here that would be to spin up as many goroutines as you want to be working at on

[go-nuts] Re: Freeing memory of a cgo library

2018-05-26 Thread jake6502
FYI, the standard way around this is to expose a "free" method from your DLL for memory allocated by the DLL. The other way is to require that users of the DLL supply the memory in advance to functions needing it. These two methods are the ones used by the Windows libraries themselves. Pretty s

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread T L
On Saturday, May 26, 2018 at 11:22:58 AM UTC-4, Li Jianhua wrote: > > > From: Ian Lance Taylor > > Sent: Saturday, May 26, 2018 2:56 PM > Subject: Re: [go-nuts] Does Golang need the innovation of C++ move > semantics too > To: Li Jianhua > > Cc: > > > > On Fri, May 25, 2018 at 8:15 PM, Li Jianhu

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread T L
On Saturday, May 26, 2018 at 11:22:58 AM UTC-4, Li Jianhua wrote: > > > From: Ian Lance Taylor > > Sent: Saturday, May 26, 2018 2:56 PM > Subject: Re: [go-nuts] Does Golang need the innovation of C++ move > semantics too > To: Li Jianhua > > Cc: > > > > On Fri, May 25, 2018 at 8:15 PM, Li Jianhu

Re: [go-nuts] Re: Is the memory allocated for x in f guaranteed to be reachable after a GC call?

2018-05-26 Thread T L
On Saturday, May 26, 2018 at 10:59:34 AM UTC-4, Matthias B. wrote: > > On Sat, 26 May 2018 07:26:12 -0700 (PDT) > T L > wrote: > > > Looks the answer is not. But any one can confirm this? > > I can tell you that your program does not have any defined behavior > according to the Go language st

[go-nuts] Counting semaphore vs Workerpool

2018-05-26 Thread karthik . 0703
I am writing an application that has to fetch data from - say a million URLs. I currently have an implementation which looks like the code below //Make sure that we just have 500 or less goroutines fetching from URLs sem := make(chan struct{}, min(500, len(urls))) //Check if all URLs in the requ

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread Li Jianhua
From: Ian Lance Taylor Sent: Saturday, May 26, 2018 2:56 PM Subject: Re: [go-nuts] Does Golang need the innovation of C++ move semantics too To: Li Jianhua Cc: On Fri, May 25, 2018 at 8:15 PM, Li Jianhua wrote: > > Why does C++ introduce move semantics anyway? What problems is it going to >

Re: [go-nuts] Re: Is the memory allocated for x in f guaranteed to be reachable after a GC call?

2018-05-26 Thread Matthias B.
On Sat, 26 May 2018 07:26:12 -0700 (PDT) T L wrote: > Looks the answer is not. But any one can confirm this? I can tell you that your program does not have any defined behavior according to the Go language standard, because your use of unsafe.Pointer to reinterpret bytes as a pointer is not one

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread Matthias B.
On Sat, 26 May 2018 03:15:45 + Li Jianhua wrote: > 1. Why does C++ introduce move semantics anyway? What problems is > it going to solve? 2. How come Golang, C (Without ++) don’t have > that move semantics yet? Will they need the move soon? > C++ is a language used among other things fo

[go-nuts] Re: Is the memory allocated for x in f guaranteed to be reachable after a GC call?

2018-05-26 Thread T L
Looks the answer is not. But any one can confirm this? package main import "fmt" import "unsafe" import "runtime" var ha0, ha1, ha2 uint64 func f() **int { for false{} // avoid f being inlined. s := make([]byte, unsafe.Sizeof((*int)(nil))) // enough memory to hold a pointer pp

[go-nuts] Is the memory allocated for x in f guaranteed to be reachable after a GC call?

2018-05-26 Thread T L
package main import "fmt" import "unsafe" import "runtime" func f() **int { for false{} // avoid f being inlined. s := make([]byte, unsafe.Sizeof((*int)(nil))) // enough memory to hold a pointer pp := (**int)(unsafe.Pointer(&s[0])) x := 123 *pp = &x return pp } va

Re: [go-nuts] go tool trace: --> filtering/modifying

2018-05-26 Thread Neven Miculinić
It's different usecase in my opinion. With open census tracing, and go's spans/regions all the work is on me putting those manually in the code --> maintaining it, refactoring, etc. I haven't tried go's new ability though. With only vanilla go trace, it's automatic. It's in the runtime, and thus I

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-26 Thread Kaveh Shahbazian
And I am in desperate need of bugs! -- 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://grou

[go-nuts] Re: New Embedded Document Database (Alpha)

2018-05-26 Thread Kaveh Shahbazian
Seven more examples added and other tiny improvements. Next step is to add CAS features. There are two main options for this: putting the CAS sequence/timestamp inside the document or as a separate value. Each one has their pros and cons. I am trying to find out which approach requires least ch