Ruby
08 Jan 2010
 

drb client

 
 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# coding: utf-8
$KCODE = "utf-8" if RUBY_VERSION < "1.9.0"
require "drb/drb"
require "benchmark"
times = Benchmark.measure do
500.times do |time|
Thread.new do
rem_o = DRbObject.new_with_uri("druby://localhost:#{45678+time}")
250.times do |c|
tmp = rem_o.start(c)
end
end
end
Thread.list.each { |t| t.join if t != Thread.main }
end
puts times.to_s