Re: [go-nuts] Going thorough "Type parameters proposal" with Go 1.18 beta

2022-02-04 Thread Ian Lance Taylor
On Fri, Feb 4, 2022 at 5:01 PM Kamil Ziemian wrote: > > > I title say, I download Go 1.18 beta (at this moment "go version go1.18beta2 > linux/amd64") and I try to work through "Type Parameters Proposal" with it >

[go-nuts] Kill child processes on parent termination (in a cross platform way)

2022-02-04 Thread Pablo Caballero
Hi, community! I know that I can achieve child processes termination upon parent death using process groups and the way to do this for POSIX with Golang (cmd.SysProcAttr = {Setpgid: true}, etc.) I also know that boost uses this approach for Posix and job objects for Windows. I tried to do the

[go-nuts] Going thorough "Type parameters proposal" with Go 1.18 beta

2022-02-04 Thread Kamil Ziemian
Hello, I title say, I download Go 1.18 beta (at this moment "go version go1.18beta2 linux/amd64") and I try to work through "Type Parameters Proposal" with it (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md). This thread is about thing that I can't

Re: [go-nuts] Go scheduler tracing questions

2022-02-04 Thread Ian Lance Taylor
On Fri, Feb 4, 2022 at 4:13 PM envee wrote: > > Hi All, > I have an application which always has about 2000 goroutines running. (I > checked this by querying prometheus metrics at regular intervals.) This > number sounds reasonably correct to me because at the start I launch 1000 > goroutines

[go-nuts] Re: Web development with Go

2022-02-04 Thread Paulo Júnior
Hi Merson. What wonderful improvements. Thanks a lot for your contribution. Paulo. Em sexta-feira, 4 de fevereiro de 2022 às 21:05:18 UTC-3, merson...@actmedical.com.au escreveu: > Paulo > > An important use case is when packaging your app in a container for > deployment in Kubernetes or

[go-nuts] Go scheduler tracing questions

2022-02-04 Thread envee
Hi All, I have an application which always has about 2000 goroutines running. (I checked this by querying prometheus metrics at regular intervals.) This number sounds reasonably correct to me because at the start I launch 1000 goroutines and each of these 1000 goroutines spawns 1 goroutine each

[go-nuts] Re: Web development with Go

2022-02-04 Thread 'merson.mat...@actmedical.com.au' via golang-nuts
Paulo An important use case is when packaging your app in a container for deployment in Kubernetes or Google Cloud Run, for e.g.. Compared to an app written in Php where you have to package the framework code into the container, the same app rewritten in Go reduces the size by a huge amount as

Re: [go-nuts] Re: [windows] c:= exec.CommandContext(ctx, ...) + c.Output() don't return when process is killed upon context expiration until child termination

2022-02-04 Thread Pablo Caballero
Hi Ian! Thank you so much for sharing that link with me. It was very enriching to read it. As I commented in my first message, the fact that the problem did not occur on Mac got me a bit confused at first. Best! On Friday, February 4, 2022 at 5:42:00 PM UTC-3 Ian Lance Taylor wrote: > On

Re: [go-nuts] Re: [windows] c:= exec.CommandContext(ctx, ...) + c.Output() don't return when process is killed upon context expiration until child termination

2022-02-04 Thread Ian Lance Taylor
On Fri, Feb 4, 2022 at 12:30 PM Pablo Caballero wrote: > > Errata > > Go is blocked trying to read from the channel (exec\exec.go): > > for range c.goroutine { if err := <-c.errch; err != nil && copyError == nil { > copyError = err } } > > I think that the problem happens if you specify an

[go-nuts] Re: [windows] c:= exec.CommandContext(ctx, ...) + c.Output() don't return when process is killed upon context expiration until child termination

2022-02-04 Thread Pablo Caballero
Errata Go is blocked trying to read from the channel (exec\exec.go): for range c.goroutine { if err := <-c.errch; err != nil && copyError == nil { copyError = err } } I think that the problem happens if you specify an io.Writer as cmd.Stdout and such writer doesn’t satisfy os.File (Output()

[go-nuts] [windows] c:= exec.CommandContext(ctx, ...) + c.Output() don't return when process is killed upon context expiration until child termination

2022-02-04 Thread Pablo Caballero
Hi, community! The problem is happening in a more complex program but I’ve written a simple program to reproduce it. package main import ( "context" "fmt" "os/exec" "time" ) func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Duration(3)*time.Millisecond) defer

Re: [go-nuts] Is Go good choice for porting graph based app?

2022-02-04 Thread 'Sebastien Binet' via golang-nuts
On Fri Feb 4, 2022 at 12:35 CET, Kamil Ziemian wrote: > Are you code available somewhere on Internet? Looking at some graph > handling code in Go would be very helpful to me. it's over there: - https://pkg.go.dev/gonum.org/v1/gonum/graph - https://pkg.go.dev/gonum.org/v1/gonum/graph/... hth, -s

Re: [go-nuts] Is Go good choice for porting graph based app?

2022-02-04 Thread Kamil Ziemian
Are you code available somewhere on Internet? Looking at some graph handling code in Go would be very helpful to me. I have a very little time today, maybe I will write more about it in future. Best, Kamil piątek, 4 lutego 2022 o 02:16:28 UTC+1 kortschak napisał(a): > On Thu, 2022-02-03 at

Re: [go-nuts] Slices of pointers or not?

2022-02-04 Thread Paulo Júnior
I appreciate your help. Em sexta-feira, 4 de fevereiro de 2022 às 00:12:47 UTC-3, ren...@ix.netcom.com escreveu: > I think the OPs question was specifically about the cost of returning from > a function - it is the same. > > > On Feb 3, 2022, at 8:03 PM, Connor Kuehl wrote: > > > > On Thu,

Re: [go-nuts] Register-based ABI benchmarks

2022-02-04 Thread Didier Spezia
Thank you - it makes sense. The first time I read https://github.com/golang/go/blob/master/src/cmd/compile/abi-internal.md I thought there were plenty of registers for parameters, even for x86_64. But with string, slices, interfaces, etc ... multiple registers are used, so it does not take so