[go-nuts] Re: when to switch a goroutine to be executed

2017-08-20 Thread Yp Xie
Pierre Durand, Thanks for your concise and accurate answer. 在 2017年8月20日星期日 UTC+8下午6:22:47,Pierre Durand写道: > > Goroutine execution is not deterministic. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: when to switch a goroutine to be executed

2017-08-20 Thread Yp Xie
Peter, Got your point, thanks! 在 2017年8月20日星期日 UTC+8下午10:09:50,peterGo写道: > > Yp Xie, > > The Go scheduler is cooperative: > https://en.wikipedia.org/wiki/Cooperative_multitasking > > You are using one processor: runtime.GOMAXPROCS(1). Force the main > goroutine t

[go-nuts] Re: when to switch a goroutine to be executed

2017-08-20 Thread Yp Xie
onfused with the results. 在 2017年8月20日星期日 UTC+8下午12:57:43,Yp Xie写道: > > Hi guys, > > I am learning golang with the fantastic book "Go in Action". And I have > some problems with understanding when to switch a goroutine to be run in > chapter 6. > > packag

[go-nuts] when to switch a goroutine to be executed

2017-08-19 Thread Yp Xie
Hi guys, I am learning golang with the fantastic book "Go in Action". And I have some problems with understanding when to switch a goroutine to be run in chapter 6. package main 1 2 import ( 3 "fmt" 4 "runtim