Skip to content

Instantly share code, notes, and snippets.

@lega911
Created April 1, 2016 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lega911/fd1e8532e1be6b553c704f1955c3d60e to your computer and use it in GitHub Desktop.
Save lega911/fd1e8532e1be6b553c704f1955c3d60e to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"runtime"
)
func green(k int) {
var i = 0;
for {
i++
if(i > 1000000000) {
i = 0
fmt.Printf("go %d\n", k)
}
}
}
func main() {
runtime.GOMAXPROCS(1)
go green(1)
//runtime.LockOSThread()
green(2)
//runtime.UnlockOSThread()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment