From 7f6e8625bbb71d4cf0826b56e152509fda00bab1 Mon Sep 17 00:00:00 2001 From: kosaki Date: Tue, 14 Jun 2011 18:54:30 +0000 Subject: [PATCH] * benchmark/bm_vm4_pass_flood.rb: new benchmark for GVL fairness. * benchmark/bm_vm4_alive_check1.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ benchmark/bm_vm4_alive_check1.rb | 6 ++++++ benchmark/bm_vm4_pass_flood.rb | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 benchmark/bm_vm4_alive_check1.rb create mode 100644 benchmark/bm_vm4_pass_flood.rb diff --git a/ChangeLog b/ChangeLog index c9c9e7d87f..e1e948a452 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jun 15 03:52:50 2011 KOSAKI Motohiro + + * benchmark/bm_vm4_pass_flood.rb: new benchmark for GVL fairness. + * benchmark/bm_vm4_alive_check1.rb: ditto. + Wed Jun 15 01:27:53 2011 KOSAKI Motohiro * thread_pthread.c (gvl_yield): fix live lock issue on 1-2 cpus diff --git a/benchmark/bm_vm4_alive_check1.rb b/benchmark/bm_vm4_alive_check1.rb new file mode 100644 index 0000000000..aebe99875d --- /dev/null +++ b/benchmark/bm_vm4_alive_check1.rb @@ -0,0 +1,6 @@ +5000.times{ + t = Thread.new{} + while t.alive? + Thread.pass + end +} diff --git a/benchmark/bm_vm4_pass_flood.rb b/benchmark/bm_vm4_pass_flood.rb new file mode 100644 index 0000000000..56b5b0a956 --- /dev/null +++ b/benchmark/bm_vm4_pass_flood.rb @@ -0,0 +1,8 @@ +1000.times{ + Thread.new{loop{Thread.pass}} +} + +i=0 +while i<10000 + i += 1 +end