Thanks for reply, Dave
I've made simple application and run it on Xeon and i5. In case of i5 I see
threads as expected, on Xeon CPU only one thread is working. May it related
with difference go versions?
i5 output (go version 1.6):
$ go run test_tr.go
Spinning thread
Spinning thread
Spinning thread
Spinning thread
Spinning thread
Thread: 4
Thread: 1
Thread: 0
Thread: 2
Xeon output (go version 1.2.1):
$ go run test_tr.go
Spinning thread
Thread: 0
^Cexit status 2
Code listing:
package main
import (
"fmt"
"math"
"sync"
)
func A1(z int, wg *sync.WaitGroup) {
fmt.Printf("Thread: %v\n",z)
var m, k float64 = 9.99999,9.999999
var i float64
for i = 0.0; i < 10000000000; i++ {
math.Sqrt(float64(m*i + k*i))
}
wg.Done()
}
func main() {
var wg sync.WaitGroup
for i := 0; i < 5; i++ {
wg.Add(1)
go A1(i, &wg)
fmt.Println("Spinning thread")
}
wg.Wait()
}
On Tuesday, December 13, 2016 at 12:56:50 AM UTC+3, Dave Cheney wrote:
>
> There are no settings to affect the scheduler save GOMAXPROCS. Check that
> none of your code or your dependencies are calling runtime.GOMAXPROCS.
>
> If that doesn't help, try profiling your application, the cpu or block
> profile might tell you where your program is hitting a point of contention.
>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.