Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created December 9, 2014 20:00
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 wuputah/13f07c5d28894643eb79 to your computer and use it in GitHub Desktop.
Save wuputah/13f07c5d28894643eb79 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
def burn
Thread.new { loop { rand() * rand() } }
Thread.new { loop { rand(100) * rand(100) } }
end
pids = (1..4).collect do
fork do
burn
end
end
Signal.trap("INT") do
pids.each { |pid| Process.kill("TERM", pid) }
end
loop { sleep(60) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment