While running a Go program that uses Cgo, I noticed a surprising number of 
threads. I believe the code below demonstrates what I'm seeing minus (what 
I hope are) extraneous details.

package main

// #include <unistd.h>
import "C"

func main() {
    for {
        C.nanosleep(&C.struct_timespec{tv_sec: 0, tv_nsec: 10000}, nil)
    }
}

If I run this program with GOMAXPROCS=1, I see 4 threads (as reported by 
top). I was expecting that number to be closer to 2.

I'm compiling with go 1.11.1 on linux/amd64.

Michael.

-- 
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://groups.google.com/d/optout.

Reply via email to