--LpQ9ahxlCli8rRTG
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Thanks a lot for your reply, Ara, and for your time!

ara.t.howard:

> to do this you'll want to combine forkoff with my slave lib: which
> sets up an object which is fronted by drb, an which can indeed be
> a singleton - note that this object is, itself, running in a child
> process, but you can ignore this for the most part.

Ahhh, a DRb another thing on my ¡Æto-read¡Ç list. :)

> a simple example:

Ah, thanks. I¡Çm a bit lost there, though:

> slave = Slave.new(:threadsafe => true){ Hash.new }
> process_global = slave.object

> ( 0 .. 4 ).each do |i|
>   process_global[i] = i ** 2
> end

This doesn¡Çt seem to be run concurrently, and
if I switch each to forkoff here it dies with

/home/shot/opt/ruby-1.8.6-p114/lib/ruby/1.8/drb/drb.rb:736:in `open': drbunix:///tmp/slave_hash_-605329008_13239_13240_0_0.32803043357426 - #<Errno::ENOENT: No such file or directory - ///tmp/slave_hash_-605329008_13239_13240_0_0.32803043357426> (DRb::DRbConnError)

> even with these abstractions you have to consider deeply what's happening 
> with threads/processes etc - but yes, it's definitely possible with little 
> code.

Is there a good place (other than the relevant docs) to read a tutorial
on DRb? I feel really stupid to ask about stuff without knowing what I¡Çm
writing about. :|



In the meantime, I tried the ¡Æsimple¡Ç forkoff approach
with just handling the returned values, but I end with

/home/shot/opt/ruby-1.8.6-p114/lib/ruby/gems/1.8/gems/forkoff-0.0.1/lib/forkoff.rb:53:in `dump': singleton can't be dumped (TypeError)

Which, exactly, object is being marshalled by forkoff? The one returned,
or the one that contains the forkoff call? (I tried removing any
singleton references from both, but to no success so far.)



Also, a humble patch:

--- slave-1.2.1.rb.orig 2008-04-24 21:01:38.000000000 +0200
+++ slave-1.2.1.rb  2008-04-24 21:02:54.000000000 +0200
@@ -11,8 +11,8 @@
 #
 # the Slave class encapsulates the work of setting up a drb server in another
 # process running on localhost via unix domain sockets.  the slave processs
-# attached to it's parent via a LifeLine which is designed such that the slave
-# cannot out-live it's parent and become a zombie, even if the parent diesnd
+# attached to its parent via a LifeLine which is designed such that the slave
+# cannot out-live its parent and become a zombie, even if the parent dies an
 # early death, such as by 'kill -9'.  the concept and purpose of the Slave
 # class is to be able to setup any server object in another process so easily
 # that using a multi-process, drb/ipc, based design is as easy, or easier,



-- Shot, loving the ¡Æslave cannot out-live its parent and become
   a zombie, even if the parent dies an early death¡Ç quote.
-- 
With some people's code, your best debugging
tool is 'rm'.            -- Jesper Lauridsen

--LpQ9ahxlCli8rRTG
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFIEORei/mCfdEo8UoRAjVxAKCqFMNfumGlWrSXSeP2+oNU6Uy8YACffm6C
z2J5B9aCHNDu8nEpOh+kofQ@ex
-----END PGP SIGNATURE-----

--LpQ9ahxlCli8rRTG--