diff options
Diffstat (limited to 'benchmark/bm_vm_thread_queue.rb')
-rw-r--r-- | benchmark/bm_vm_thread_queue.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/benchmark/bm_vm_thread_queue.rb b/benchmark/bm_vm_thread_queue.rb index b3adcc24a5..37381ae62b 100644 --- a/benchmark/bm_vm_thread_queue.rb +++ b/benchmark/bm_vm_thread_queue.rb @@ -1,18 +1,18 @@ -require 'thread'
-
-n = 1_000_000
-q = Queue.new
-consumer = Thread.new{
- while q.pop
- # consuming
- end
-}
-
-producer = Thread.new{
- n.times{
- q.push true
- }
- q.push nil
-}
-
-consumer.join
+require 'thread' + +n = 1_000_000 +q = Queue.new +consumer = Thread.new{ + while q.pop + # consuming + end +} + +producer = Thread.new{ + n.times{ + q.push true + } + q.push nil +} + +consumer.join |