[ENH][VM] Interpreter>>getThisSession or why not UUID

John M McIntosh johnmci at smalltalkconsulting.com
Tue Nov 20 20:02:27 UTC 2001


>"David T. Lewis" wrote:
>>
>>  On Tue, Nov 20, 2001 at 04:26:14AM +0100, Stephan Rudlof wrote:
>>  > David,
>>  >
>>  > I have some remarks and ideas.
>>  >
>>  > From your changeset:
>>
>>      <snip>
>>
>>  > For ensuring that the session identifier is unique among all instances of
>>  > Squeak in a network this is *not* a safe method. But I have to admit: for
>>  > just a *few* instances it should almost always work...
>>  > But imagine a collaboration of thousands of Squeaks...
>>
>>  Yes, I agree.  Actually, my change set does not alter the current
>>  method of generating a session ID, it only moves it from FilePlugin
>>  to Interpreter, and puts the actual C code into a macro in the sq.h
>>  file.
>>
>>  > So I´d like to have a sessionID which consists of two parts:
>>  > - a startupSessionID which changes for each startup of the image where it
>>  > belongs to by incrementing it;
>>  > - an imageSessionID which identifies the image used.
>>  >
>>  > Some time ago I´ve implemented the first one by storing it 
>>inside the image.
>>  > It is named as sessionID in the attached changeset 
>>VM_cachingMissingModules,
>  > > which also contains some other stuff.
>>


Mmm why not just use the UUID logic UUIDPlugin_primitiveMakeUUID that 
will make a *fairly* unique id for us.

http://www.opengroup.org/dce/info/faq-mauney.html#Q2_26

the UUID is a combination of the network address and current time at 
the moment and place it was generated. Assuming that network 
addresses are unique and that time never runs backwards, this 
guarantees that UUIDs really are unique

Also see http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt

Now I do have some source code in the VMMaker tree to generate this, 
but I'm unhappy with the complexity, besides most platforms 
(unix/mac,windows) now generate a UUID via system calls. However I'm 
looking at generate an UUID based on mostly pure Smalltalk code 
versus unpure C code.
-- 
--
===========================================================================
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