[Vm-dev] Detecting objects that point to an object

Andreas Raab andreas.raab at gmx.de
Wed Jul 21 08:08:31 UTC 2010


On 7/20/2010 1:45 PM, stephane ducasse wrote:
> the idea was to use imagesegment but to see if we could then grow the graph to include under the root the outpointers
> and sawp everything at once witohut having a part of the subgraph not swapped.
> The problem with imagesegment (netsyle guys discovered it badly) is that if you have outpointers you may end up
> have to kill the curretn process and other friends to get rid of outpointers so that you can save your complete rooted graphs.
> For seaside for example
> 	fork an image
> 	kill everything
> 	save the graph without outpointers
> 	throw away the image....
> not that friendly at the end.

That is exactly what Croquet does: Launch an image, instantiate an 
island, run some stuff, then create a snapshot of the island, send this 
to another image, instantiate it there. Rinse and repeat for every new 
participant. It works perfectly fine if and only if:

1) You can control the pointers into the object graph. This is required 
since otherwise you are unable to ensure that you cover the full set of 
objects required for the object graph (island).

2) You don't use global mutable state. Global mutable state introduces 
sharing violations in Croquet since I haven't found a way to implement 
island-relative globals efficiently (they're just too slow for everyday 
use).

3) You can assume identical code bases in your images. If you have 
different code or shape changes between your image all bets are off.

Cheers,
   - Andreas

>
> Stef
>
> On Jul 20, 2010, at 8:20 PM, Bert Freudenberg wrote:
>
>>
>> On 20.07.2010, at 04:47, Mariano Martinez Peck wrote:
>>
>>>
>>>
>>> On Mon, Jul 19, 2010 at 7:59 PM, Eliot Miranda<eliot.miranda at gmail.com>  wrote:
>>>
>>>
>>>
>>> On Mon, Jul 19, 2010 at 7:35 AM, Igor Stasenko<siguctua at gmail.com>  wrote:
>>>
>>> Mariano, can you tell us, why you need to know, how many objects pointing to
>>> a specific one?
>>> The reference counting is well known solution to this, but it is less
>>> effective than garbage collection
>>> (in terms of memory management), since you have to touch the counters
>>> at each memory write.
>>>
>>> and recursively when objects are freed.
>>>
>>> Further, for two reasons one will also need a scan-mark garbage collector to collect all garbage.  It is inevitable that one won't waste space on a reference count that can hold the max number of references and so the system will have to deal with a max count and have some objects with an overflowed count.  Reference counting cannot easily deal with circularities and so a cycle of references will result in non-zero ref counts for nodes in the cycle and prevent garbage collection.
>>>
>>>
>>>
>>> Thanks for the answers. Maybe I should have explained why I needed that. What I had in mind, is to be able to detect subgraphs. But not any kind of subgraphs, but only those on which ALL objects are ONLY reachable from the root of the subgraph. This means, that there are no objects outside the graph, pointing to objects inside the graph. In ImageSegment word, would mean to detect subgraphs that don't have outPointers.
>>
>> So why not simply use an ImageSegment? IIRC that's how Croquet islands are checked for closedness.
>>
>> - Bert -
>>
>>
>
>


More information about the Vm-dev mailing list