2011-04-28 21:44:32 -04:00
|
|
|
# Plenty Thtread.pass
|
|
|
|
# A performance may depend on GVL implementation.
|
|
|
|
|
|
|
|
tmax = (ARGV.shift || 2).to_i
|
2011-05-04 09:14:28 -04:00
|
|
|
lmax = 200_000 / tmax
|
2011-04-28 21:44:32 -04:00
|
|
|
|
|
|
|
(1..tmax).map{
|
|
|
|
Thread.new{
|
|
|
|
lmax.times{
|
|
|
|
Thread.pass
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.each{|t| t.join}
|
|
|
|
|
|
|
|
|