=== Top of the Swiki === Attachments ===

Squeak-Thor

Thor, developed at MIT, is a distributed, object database system consisting of two kinds of processes: client Front Ends (FE's), and server Object Repositories (OR's). You can think of an FE as a Squeak VM and an OR as a Squeak image. However, multiple FE's can acceess multiple OR's, concurrently, and objects in an OR can reference objects in other OR's. This allows a world wide web of objects that can be accessed concurrently and consistently by a world of users. When a user wants to let the world see what changes he has made he commits his transaction (like saving an image).

No special code is needed for fetching or saving objects. When an object pointer is followed in the code and that object has not yet been loaded into the FE, a fetch is automatically sent to the OR where the object resides. The OR returns the disk page that the object resides on to the FE. The FE caches each object on the returned page and updates object pointers. A whole disk page is returned because it is cheap to fetch and send a whole page and it is likely that objects on the same page will be needed in the future. Like virtual memory, objects that are no longer used (and not changed) are dropped from the cache to make room for new objects coming in. For object-oriented applications like a CAD program, MIT benchmarks have shown that Thor is faster than C++ accessing data in files (even memory-mapped files).

The objects in Thor are implemented in Theta, a programming language similar to Java, and designed in conjunction with Thor at MIT. Every variable and method must have a type. Types are just interfaces and classes implement those interfaces. Unlike, Java, Theta supports parametric polymorphism and basic types are real objects. To optimize message sends, the Theta compiler creates a method dispatch vector for each type a class implements. The runtime system also does further customization when it discovers that there is only one implementation of a message. It changes the message send to a direct procedure call or directly inlines the procedure.

I've tried replacing the ObjectMemory in the VM with an interface to Thor, but it was too slow. For every slot that was read from memory in Squeak a method was invoke in Theta to retrieve the slot from the Thor object that represented the Squeak object. I had 5 classes of objects to represent Squeak objects: PointerObject, WordObject, ByteObject, PointerThenByteObject (for CompiledMethods), and SmallIntegerObject. Instead of having this extra layer between Squeak and Thor. I want to tightly integrate Squeak and Thor.

The Theta compiler highly optimizes the code to make up for the slow down of using the object level persistence. I would like to do the same with Squeak. But to do significant optimization we will need to add type information to Squeak. I'm thinking of adding optional types and type inference, and optimize where we can.

Anthony Hannan, October 2000