咳といいます。

>>>>> "S" == Masatoshi SEKI <m_seki / mva.biglobe.ne.jp> writes:

    S> class TupleSpace < Queue
	略
    S> end

サンプルを柳川さんのLindaのサンプル風に書き直してみました。

if __FILE__ == $0
  ts = TupleSpace.new
  clients = []
  servers = []

  def server(ts)
    Thread.start {
      loop do
	req = ts.out {|x| x[0] == 'req'}
	ac = req[1]
	num = req[2]
	ts.in([ac, num + num])
      end
    }
  end

  def client(ts, n)
    Thread.start {
      ac = Object.new
      ts.in(['req', ac, n])
      ans = ts.out {|x| x[0] == ac}
      puts "#{n}: #{ans[1]}"
    }
  end

  3.times do 
    servers.push(server(ts))
  end

  (1..6).each do |n|
    clients.push(client(ts, n))
  end

  clients.each do |t|
    t.join
  end
end