Re: [go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread jmontgomery
On Wednesday, March 8, 2017 at 9:50:09 AM UTC-5, Chris Hines wrote: > > The infinite loops in each function will busy loop and consume a core > without allowing the runtime scheduler a chance to run other goroutines on > that core. If your virtual machine doesn't have enough cores then some > go

Re: [go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread ascii88
Fantastic! In my main program I had the main in an infinite for. That was burning the only core of my vm. I've changed that to select and now it's working fine. Thank you Konstantin, for your answer, too. El miércoles, 8 de marzo de 2017, 11:50:09 (UTC-3), Chris Hines escribió: > > The infinite

Re: [go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread Konstantin Khomoutov
On Wed, 8 Mar 2017 06:20:25 -0800 (PST) asci...@gmail.com wrote: > I've made this test program > > > package main > > import "fmt" > > func func1() { > fmt.Println("running func1") > for { > > } [...] > func main() { > > go func1() > fmt.Println("run func1") > go func

Re: [go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread Chris Hines
The infinite loops in each function will busy loop and consume a core without allowing the runtime scheduler a chance to run other goroutines on that core. If your virtual machine doesn't have enough cores then some goroutines may starve. Change the loops to select {} to block infinitely withou

Re: [go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread ascii88
I've made this test program package main import "fmt" func func1() { fmt.Println("running func1") for { } } func func2() { fmt.Println("running func1") for { } } func func3() { fmt.Println("running func1") for { } } func main() { go func1() fmt

Re: [go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread Ayan George
On 03/08/2017 08:30 AM, asci...@gmail.com wrote: > In the main function I call various go routines, I've set println after > each call, so I know they are being executed. But I don't get the > printlns I've set inside of some of those routines, for the same purpose. > So you are seeing some Pr

[go-nuts] Cross compiling from Windows to Linux produces non-working go routines

2017-03-08 Thread ascii88
Hello, I'm running go1.8 windows/amd64 I have a working program, which I want to compile to Linux. So I set GOOS=linux and then go build I have a virtual machine with Debian 7. And I run the program. However it functions incorrectly. In the main function I call various go routines, I've set pr