[FIX] UUID-Fix-CdG

John M McIntosh johnmci at smalltalkconsulting.com
Tue Nov 19 22:03:18 UTC 2002


Well let me twitch a bit and point I think we're misplaced on where to  
fix the problem.

Really we should look at Random>>initialize
	" Set a reasonable Park-Miller starting seed "

and follow the comments suggestion because it does the 	
[seed := (Time millisecondClockValue bitAnd: 16r3FFFFFFF) bitXor: self  
hash.
	seed = 0] whileTrue: ["Try again if ever get a seed = 0"].

step anyways, then ignore seed if told too.

Also reviewing the callers of Random seed: might be interesting.

so really your makeUnixSeed, makeSeedFromSound should go in Random,  
with say
some osVersion checking to avoid opening /dev/urandom on all the  
macintoshs and
windows boxes in the world.

I see that OS-X has /dev/urandom but you can't get to it from here  
because the mac VM currently
only likes HFS+ file names and I've not discovered how to make such a  
thing. Others are welcome to try.

MM adding a primitive call to say this is a posix file name might be an  
interesting thing for all platforms.
See file naming conventions/insanity...

Also lowering overhead at startup time is good, how many ms does this  
add if we need to load some sound microphone drivers
powerup the stereo etc?

On Tuesday, November 19, 2002, at 01:01  PM, cg at cdegroot.com wrote:

> from preamble:
>
> "Change Set:		UUID-Fix-CdG
> Date:			19 November 2002
> Author:			Cees de Groot
>
> This patch tries to make it less likely that the same UUID is generated
> twice:
> - On startup, the default generator is flushed;
> - The system tries harder to get a quality random seed, first from
> /dev/urandom
>   (on lots of Unix systems), then from the sound input. If they both
> fail, it
>   generates one based on the millisecond clock and the current  
> date/time
> "!<UUID-Fix-CdG.cs.gz>
--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Squeak-dev mailing list