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