[perl #59472] [TODO] Randomize hash seed

Christoph Otto via RT parrotbug-followup at parrotcode.org
Sat Dec 20 02:15:13 UTC 2008


On Fri Oct 17 09:25:51 2008, chromatic at wgz.org wrote:
> On Thursday 16 October 2008 11:22:20 Andrew Whitworth via RT wrote:
> 
> > On Tue Sep 30 04:34:58 2008, bernhard wrote:
> 
> > > In src/hash.c:816 there is a TODO comment:
> > >
> > >   /* TODO randomize */
> > >     hash->seed = 3793;
> > >
> > > This needs to be investigated and probably implemented.
> >
> > I assume it would be easy to take Parrot_intval_time() as the seed
> here,
> > or some function of it. Are there any specific boundaries on how
> > large/small this number has to be, whether it has to be prime or
> > pseudoprime, etc?
> 
> With our current hash implementation, I'm not sure it matters.  (A
> bucket size
> that's always a power of two makes the resizing algorithm somewhat
> easy, but
> I have my doubts about its distributive powers....)
> 
> -- c
> 

Hash seed randomization is implemented in r34127.  Instead finding all
the places where Parrot needs to mark strings as shared, I just made
sure that any child interpreters inherit the hash seed from their parent.
It didn't cause any new test failures, so I'm marking this ticket resolved.


More information about the parrot-dev mailing list