From: Eric Hodel Date: 2006-04-12T02:47:01+09:00 Subject: Re: do i have to use DRbUndumped? Not quoting past messages is very bad form. Please quote relevant parts of the message you are replying to. On Apr 11, 2006, at 12:29 AM, xaea alvein wrote: > thanx, it indeed can replace DRbUndumped, but with the same > consequence: > it is still a pass-by-reference thing, which is rather dangerous to be > used when working with tuplespace's read operation. #read is not dangerous. #take can lose the object if the taking node quits before receiving the object, so you should use a TupleSpaceProxy whenever you take tuples. > consider this, what if two clients read the same object written by > some > server, and one of the client modifies the object (hoping it would > only > change his "copy of object"). using DRbUndumped or this alternative > marshalling is a bad method, since the object would still appear > changed > on both clients. That is as intended. It is called Distributed Ruby after all. It sounds like you really want some kind of access control or locking mechanism. > what i really need is a pass-by-value marshalling so that the one > written into the space is actually the copy of the real object, and > not > the reference to it. can anyone help me? i believe the drawback of > having the client to own physical copy of the object's class (i.e. the > object's source code) is not something to be worried about. or is > there > any other disadvantage of using pass-by-value compared to using > pass-by-reference, maybe speed / execution time? Your problem seems to be an implementation detail. It seems you want an object usable by only one node at a time. You should either use take to remove the object from the TupleSpace or provide locking via the TupleSpace to prevent other nodes from fiddling with your object while one node is working on it. Pass by reference allows a transparent object space. Pass by value is going to complicate your design much more than building atop of the primitive operations TupleSpace provides. > i currently combine Rinda::TupleSpace and Rinda::Ring instead of > putting > the tuplespace as a DRbServer's front object, trying to make the whole > thing works like jini I don't understand what this means. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com