Skip to content

Instantly share code, notes, and snippets.

@nolman
Created September 1, 2011 18:50
Show Gist options
  • Save nolman/1186925 to your computer and use it in GitHub Desktop.
Save nolman/1186925 to your computer and use it in GitHub Desktop.
# Eventually some non deterministic difference of signals received
missed signal @cont_count: 428 @usr2_count: 439
@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
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