[Cross-space references] NewtonOS and Sessions

Withers, Robert rwithers at quallaby.com
Thu Aug 23 23:25:04 UTC 2001


Jecel,  comments below but no opportunities for snipping, yet.   :)

> -----Original Message-----
> From: Jecel Assumpcao Jr [mailto:jecel at merlintec.com]
> 
> On Thursday 23 August 2001 02:14, Rob Withers wrote:
> > > ["cached smart references"]
> >
> > It's a pointer swizzle.  I like the idea of controlling the 
> reference
> > and changing it's state (perhaps by an optimizing manager 
> and not the
> > client of the reference), like faulting the methods or state locally
> > or defaulting then remotely.
> 
> These days I would call the "optimizing manager" a 
> meta-object and the 
> reference itself would be a proxy. This seems cleaner than 
> just a block 
> and a fixed-in-the-vm optimizing hack.

I think this is where the GC would operate as well.  I almost had one
working, but I didn't finish the GC, because of the additional coordination
that was required.  I need to resuscitate this code too.  Are we both
thinking that some heuristic would cache state locally, like the Gemstone
Proxy model?  More advanced optimizations as well - one that I like is
usage-based relocation.  To increase access locality, we may want to make a
remote object, local, and then it would be remote in the former local space.
:-D

> It is an interesting and flexible way to do things, but I am 
> trying to 
> figure out what "the simplest thing that could possibly work" is.

I am really keen, as I have mentioned once or twice, on abstracting all
types of cross space references, into the same pattern.  Then the references
can be configured and plugginized for the specific space properties.

> > >          myGraph := rmObj graph.
> >
> > SRP, that I just mentioned, does this with rules that 
> control whether
> > an object is pass-by-value or pass-by-reference and whether the
> > MetaState should be serialized.  Always make external references
> > smart, seems like the simplest design.
> 
> I found SRP very interesting though it seems to be designed for "off 
> line" transfer of binary objects between systems and not for 
> performance critical operation. Its compressed encoding was the 
> inspiration for my own variations on this idea.

Not true, in my experience.  All of the examples with the base are to and
from disk, but it is an ObjectStream and as such, it can be opened on an
underlying stream  (BufferedSocketStream of some kind).  I actually chunked
each flattened graph, and read in chunks at the other side.  Squeak sockets
had the occasion to return nil and other peculiarities; Socket and the
streams aren't (or weren't) positional.  The real solution, IMHO, is to use
Flow's NetStream as the underlying stream.

> Can you convert internal references into smart external ones 
> automatically? 

This was done by the SubstitutionRule, that I wrote.  For 'matching' (hah!)
objects, it would register the object in a local table with a new local
handle.  At the remote site, I would register the handle in a table.
Out-pointers and In-pointers.  At the remote site, I would wrap the handle
in a Proxy.  I need to look at GemBuilder for Squeak.

> Texas. They 
> depend on human generated names for roots. If you are going to have 
> lots of references with names like "obj231234" you might as well give 
> up on human understandable external pointers.

I used locally unique handles, and the proxy had the Space reference
(Segment).

> > > where rmObj is a carefully hand crafted "root" in the 
> other segment
> > > but its graph is not.
> >
> > Gemstone controls the fault depth for a graph of objects.  It says
> > only fault in objects within 2 edges of me and stub the rest.   That
> > would lead to localization of objects accessed often and dynamically
> > determine the clusters that get faulted.
> 
> This is also a great way to avoid getting stuck in circular 
> references 
> :-)

I don't follow you here.  How does it avoid this?  I think there is extra
work to do, with the LoadRecepticles of SRP, to avoid this.  For one
Marshalling it does and one pass with forwarding pointers, but there is more
identity issues for objects between marshallings.
 
> > If the references are handles to a table, and we can restrict access
> > to that table, then we can really hide external objects from prying
> > hands. 
> 
> My tables were protected by the virtual machine hardware. Any attempt 
> to access them trapped to the OS (boot session) which could 
> do anything 
> it wanted to with it.

Very cool! 
 
> > I also liked the idea in Newton  of using Ports for
> > communication.
> 
> I think other systems (iAPX432, Mach, BeOS...) have something similar.

I originally got this idea from David Caster, who implemented it once, in
Squeak.  He could call into the image from external land, in a synchronized
way.  This is the inspiration for the queues and futures work that I did,
and he helped me considerably.

cheers,
Rob

> -- Jecel
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010823/f30095c8/attachment.htm


More information about the Squeak-dev mailing list