Robert Klemme wrote:
Ah, I see. Yes in that case the DRb approach is probably better. In
that case I'd still use fork with a block to spawn child processes - the
big advantage is that you do not have to fiddle with path information
(e.g. if "ruby" is not on your path) and you do not have to transfer
information (i.e. DRb port number) via command line arguments. It may
or may not be a disadvantage to have all the code in one script - that
depends; OTOH if it's larger then it's probably reasonable to place
classes in separate files anyway.
Yes,fork with a block is really better. By using fork, I don't need to
consider the extra path dependency problem, I don't need to transfer
arguments to child process via command line.
But I am sorry that fork is not supported on my out-of-date windows 98
, a 350MHz one. It seems that I have to upgrade my PC now. It gives me
more and more troubles. For example, I cannot install VMWare on windows
98 too.
FYI, below is the result of using fork on my machine:
irb(main):001:0> fork {puts "hello"}
NotImplementedError: The fork() function is unimplemented on this
machine
from (irb):1:in `fork'
from (irb):1