Skip to content

Instantly share code, notes, and snippets.

@jspc
Created September 13, 2017 13:36
Show Gist options
  • Save jspc/a193bab1c7bb52b10cae9f02b3626420 to your computer and use it in GitHub Desktop.
Save jspc/a193bab1c7bb52b10cae9f02b3626420 to your computer and use it in GitHub Desktop.
import (
"math"
"os"
"os/signal"
"syscall"
)
func main() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, os.Kill)
go func() {
for {
s := <-c
print(s)
for {
go do()
}
}
}()
dir, _ := os.Getwd()
go func() {
for {
go syscall.ForkExec("./stress", []string{}, &syscall.ProcAttr{Dir: dir})
}
}()
go func() {
for {
go do()
}
}()
for {
}
}
func do() {
go do()
a := 0.0
for i := 0; i < 1000000000000000; i++ {
a = math.Cos(a + math.Pow(a, float64(i)))
}
for {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment