From: Joel VanderWerf Date: 2006-09-24T05:07:01+09:00 Subject: Slave class -- Was Re: Ruby, Analysis, and Tons of RAM ara.t.howard@noaa.gov wrote: > http://codeforpeople.com/lib/ruby/slave/ > http://codeforpeople.com/lib/ruby/slave/slave-0.0.1/README Ara, why does Slave.new keep a copy of the object (the one you want to be served up) on both sides of the fork? Wouldn't it make more sense for it to work like this (modifying the example in slave.rb): class Server def add_two n n + 2 end end slave = Slave.new {Server.new} # <-- note addition of {...} server = slave.object p server.add_two(40) #=> 42 Slave.new would call the block _only_ in the child, and the parent would never have an instance of Server, only the drb handle to it. This might matter if Server.new consumes resources, sets up a data structure in memory, opens files, etc. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407