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
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
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
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
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
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
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