-
-
Save lega911/fd1e8532e1be6b553c704f1955c3d60e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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