If I try your same code in GO 1.14 (with the command GOMAXPROCS=2 GODEBUG=schedtrace=1 ./work-stealing, where work-stealing is the name of the executable) I get a different picture, with a more equal distribution of goroutines for the 2 processors)

Image for post
Image for post

Do you think this depends on the different version of GO?

Thanks in advance

A man with passion for code and for some strange things that sometimes happen in IT organizations. Views and thoughts here are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store