Encounter a confused situation :
let's say we have a for { select }
function which is written in Go.
Here the code below:
package main
//import "fmt"
func main(){
for {
select {
default:
_=1 1. first situation
// fmt.Sprint("aa") 2. second situation
}
}
}
while in the first situation the cup usage shows below: in the second situation the cpu usage shows below:
I guess something happened in fmt.Println .
May be related to the mechanism of Go's fmt realization?
Not quite sure how it happens by using all the CPUs?
Thanks in advance !