[squeak-dev] true hash

Bert Freudenberg bert at freudenbergs.de
Thu May 10 21:06:38 UTC 2012


On 10.05.2012, at 21:15, Chris Muller wrote:

> Gentlemen.  Models extend outside the image and that's the context
> I've been describing the issue from the start of the thread.  The
> example for Bert was just a "sub-case" of the more general problem, I
> was just trying to be illustrative with a more close-to-home scenario.
> 
> Please tell me what is your solution for the case where the legacy
> persistent model is a MagmaDictionary hosted on-line with 60M elements
> in it -- running right now in production?  rehash is no solution even
> if it were possible and feasible, because each of hundreds of
> *clients* might have different hash values for true, so the shared
> model is being corrupted.  I argue they should be consistent.
> 
> I accept the counter-argument that this "probably wouldn't ever
> happen" -- but I'm also concerned about the *severity* of the
> punishment were it to occur, which I've already laid out.  The
> solution is painless, I do not understand your objections..
> 
> Smalltalk is breaking out of the local image, expanding into the
> network, so we should accept the idea of a universal "value" of true,
> not just the true object local to the running image.  For that idea to
> be safer, we should NOT continue to depend on true's #identityHash --
> just as Bert said was a bad idea.  We should instead allow the
> identityHash to vary independently from its #hash, a constant, in case
> it needs to again (as it did on 12/1/2009).


Nothing I can think of depends on the actual value of the hash of true. All that is needed is that in a given image, it is constant, since true is a constant.

I must still be missing something. "Models extend outside the image", true. But leaking implementation detail into the external model is just bad design. And the hash of an object is very much an implementation detail, IMHO. 

I think what you are saying is, that instead of leaving that work to the server, clients in Magma perform some index calculation on their own, based on the object's hash, and send that index to the server? Or they rely on iterating order in the dictionary to be the same on the server? Something like that?

- Bert -



More information about the Squeak-dev mailing list