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

Colin Putney cputney at wiresong.ca
Wed Jul 21 14:40:27 UTC 2010


On 2010-07-21, at 1:08 AM, Andreas Raab wrote:

> 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.

For what it's worth, 2) and 3) are kind of soft. If you follow them strictly, things will work well. But sometimes you can cheat and get away with it.

For example, DabbleDB uses ImageSegments to deploy new versions of the app without having to compile the code in thousands of images. Each image dumps its data out as an ImageSegment, and an image with the new code reads the data in. That clearly violates 3), but with a little care about shape changes and some post-load code to tweak state here and there, it works.

Colin


More information about the Vm-dev mailing list