summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-04 16:47:17 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-04 16:47:17 +0000
commit1267dad8daf1719ce14f23c324ec8b2cd49b1f1e (patch)
tree55e2c0e1ec0c6199db7f59a29b97d462f677b7cb /benchmark
parentfd6dd50f95ebdee32870eda101394e7aa7cb629c (diff)
benchmark/bm_vm_thread_pass_flood.rb: add comment
I was about to write off this benchmark while working on GVL improvements on multi-core systems. However I noticed it exposes a weakness in my work-in-progress code when I tested on an old single CPU system. Further testing reveals setting CPU affinity ("schedtool -a 0x1" on Linux) on a modern multi-core system is enough to reproduce the problem exposed by this benchmark. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_vm_thread_pass_flood.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb
index 27157d1a6f..a660aafc18 100644
--- a/benchmark/bm_vm_thread_pass_flood.rb
+++ b/benchmark/bm_vm_thread_pass_flood.rb
@@ -1,3 +1,5 @@
+# n.b. this is a good test for GVL when pinned to a single CPU
+
1000.times{
Thread.new{loop{Thread.pass}}
}