Created
September 1, 2011 18:50
-
-
Save nolman/1186925 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
# Eventually some non deterministic difference of signals received | |
missed signal @cont_count: 428 @usr2_count: 439 |
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
@cont_count = 0 | |
@usr2_count = 0 | |
trap("CONT") { @cont_count +=1; } | |
trap("USR2") { @usr2_count +=1; } | |
while true | |
puts "missed signal @cont_count: #{@cont_count} @usr2_count: #{@usr2_count}" if @cont_count != @usr2_count | |
end |
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
while true | |
Process.kill("USR2", pid) #pid of signal_handler.rb | |
Process.kill("CONT", pid) #pid of signal_handler.rb | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment