[Vm-dev] Re: [Pharo-dev] Image Segment semantics and weakness

Esteban Lorenzano estebanlm at gmail.com
Mon Oct 20 20:00:06 UTC 2014


> On 20 Oct 2014, at 21:41, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> 
> 
> On Mon, Oct 20, 2014 at 8:26 AM, stepharo <stepharo at free.fr <mailto:stepharo at free.fr>> wrote:
> While I as a big fan of imageSegment and proposed to mariano to work on imageSegment2 (it was the original idea for his phd)
> he convinced us that imagesegment were not worth their complexity.
> 
> I absolutely agree.
>  
> So why do you want to have imageSegment?
> 
> Because of backwards-compatibility.  If Spur does not provide image segments then the barrier to entry for Terf, eToys and Squeak may be too high.  Spur is supposed to be a plug-in replacement for Cog, not something that requires lots of effort to port to.

but… (and tell me if I’m saying something stupid), it would be probably better to ask the guys using ImageSegments to spend some time doing an adaptor to use fuel (who is already there, works fine and faster than ImageSegments itself). In the not-so-long term, is better investment that make you replicate a technology that we all agree is not the best option (also, I would bet is better to use your valuable time in other stuff). 
Is not that there is no alternative to IS… and also, the IS binary format for Spur will not be compatible with the older one, so… why not?

anyway, that’s my 2c

Esteban

>  
> Stef
> 
> 
> 
> On 20/10/14 03:01, Eliot Miranda wrote:
>> Hi All,
>> 
>>     I want to check my understanding of reference semantics for image segments as I'm close to completing the Spur implementation.  Specifically the question is whether objects reachable only through weak pointers should be included in an image segment or not.
>> 
>> Remember that an image segment is created from the transitive closure of an Array of root objects, the segment roots. i.e. we can think of an image segment as a set of objects created by tracing the object graph from the segment roots.
>> 
>> The segment always includes the segment roots.  Except for the roots, objects are excluded from the segment that are also reachable form the roots of the system (the system roots, effectively the root environment, Smalltalk, and the stack of the current process).
>> 
>> Consider a weak array in the transitive closure that is not reachable from the system roots, and hence should be included in the segment.  Objects referenced from that weak array may be in one of three categories
>> 
>> - reachable from the system roots (and hence not to be included in the segment)
>> - not reachable form the system roots, but reachable from the segment roots via strong pointers (and hence to be included in the segment)
>> - not reachable form the system roots, not reachable from the segment roots via strong pointers
>> 
>> Should this last category be included or excluded from the segment?  I think that it makes no difference, and excluding them is only an optimization.  The argument is as follows.  Imagine that immediately after loading the image segment there is a garbage collection.  That garbage collection will collect all the objects in the last category as they are only reachable from the weak arrays in the segment.  Hence we are free to follow weak references as if they are strong when we create the image segment, leaving it to subsequent events to reclaim those objects.  
>> 
>> An analogous argument accounts for objects reachable from ephemerons.  Is my reasoning sound?
>> -- 
>> best,
>> Eliot
> 
> 
> 
> 
> -- 
> best,
> Eliot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20141020/d52639e6/attachment.htm


More information about the Vm-dev mailing list