Created
December 9, 2014 20:00
-
-
Save wuputah/13f07c5d28894643eb79 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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