Skip to content
Newer
Older
100644 21 lines (19 sloc) 249 Bytes
a72f033 @nobu * properties.
nobu authored Jun 13, 2011
1 # 1000 threads, one mutex
2
3 require 'thread'
4 m = Mutex.new
5 r = 0
f44446c @kosaki * benchmark/bm_app_erb.rb: increase loop count. too short
kosaki authored Jul 1, 2011
6 max = 2000
a72f033 @nobu * properties.
nobu authored Jun 13, 2011
7 (1..max).map{
8 Thread.new{
7796c7d @ko1 * benchmark/bm_vm1_lvar_init.rb: added.
ko1 authored May 27, 2012
9 i = 0
a72f033 @nobu * properties.
nobu authored Jun 13, 2011
10 while i<max
11 i+=1
12 m.synchronize{
13 r += 1
14 }
15 end
16 }
17 }.each{|e|
18 e.join
19 }
20 raise r.to_s if r != max * max
Something went wrong with that request. Please try again.