Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a modified version that doesn't stall:

  package main

  import "fmt"
  import "runtime"

  func main() {
    go hog()
    for i := 0; ; i++ {
      fmt.Println(i)
    }
  }

  func hog() {
    for {
      runtime.Gosched()
    }
  }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: