ruby-changes:21729
From: usa <ko1@a...>
Date: Thu, 17 Nov 2011 20:24:18 +0900 (JST)
Subject: [ruby-changes:21729] usa:r33778 (trunk): * benchmark/bm_io_select[23].rb: use Process::RLIMIT_NOFILE only when
usa 2011-11-17 20:24:07 +0900 (Thu, 17 Nov 2011) New Revision: 33778 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33778 Log: * benchmark/bm_io_select[23].rb: use Process::RLIMIT_NOFILE only when it is defined. if it is not defined, assume 64 as the max of fds. Modified files: trunk/ChangeLog trunk/benchmark/bm_io_select2.rb trunk/benchmark/bm_io_select3.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 33777) +++ ChangeLog (revision 33778) @@ -1,3 +1,8 @@ +Thu Nov 17 20:23:03 2011 NAKAMURA Usaku <usa@r...> + + * benchmark/bm_io_select[23].rb: use Process::RLIMIT_NOFILE only when + it is defined. if it is not defined, assume 64 as the max of fds. + Thu Nov 17 10:36:46 2011 Aaron Patterson <aaron@t...> * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are Index: benchmark/bm_io_select3.rb =================================================================== --- benchmark/bm_io_select3.rb (revision 33777) +++ benchmark/bm_io_select3.rb (revision 33778) @@ -2,7 +2,11 @@ ios = [] nr = 100 -max = Process.getrlimit(Process::RLIMIT_NOFILE)[0] +if defined?(Process::RLIMIT_NOFILE) + max = Process.getrlimit(Process::RLIMIT_NOFILE)[0] +else + max = 64 +end puts "max fd: #{max} (results not apparent with <= 1024 max fd)" (max - 10).times do Index: benchmark/bm_io_select2.rb =================================================================== --- benchmark/bm_io_select2.rb (revision 33777) +++ benchmark/bm_io_select2.rb (revision 33778) @@ -2,7 +2,11 @@ ios = [] nr = 1000000 -max = Process.getrlimit(Process::RLIMIT_NOFILE)[0] +if defined?(Process::RLIMIT_NOFILE) + max = Process.getrlimit(Process::RLIMIT_NOFILE)[0] +else + max = 64 +end puts "max fd: #{max} (results not apparent with <= 1024 max fd)" ((max / 2) - 10).times do -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/