Исходники и презентации
This commit is contained in:
19
lessons/goroutines_and_scheduler/endless_loop/main.go
Normal file
19
lessons/goroutines_and_scheduler/endless_loop/main.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(1)
|
||||
|
||||
var i int
|
||||
go func() {
|
||||
for {
|
||||
i++
|
||||
}
|
||||
}()
|
||||
|
||||
fmt.Println(i)
|
||||
}
|
||||
Reference in New Issue
Block a user