A system is provided that facilitates space and time dimensional execution
of computer programs through selective versioning of memory elements
located in a system heap. The system includes a head thread that executes
program instructions and a speculative thread that simultaneously executes
program instructions in advance of the head thread with respect to the
time dimension of sequential execution of the program. The collapsing of
the time dimensions is facilitated by expanding the heap into two
space-time dimensions, a primary dimension (dimension zero), in which the
head thread operates, and a space-time dimension (dimension one), in which
the speculative thread operates. In general, each dimension contains its
own version of an object and objects created by the thread operating in
the dimension. The head thread generally accesses a primary version of a
memory element and the speculative thread generally accesses a
corresponding space-time dimensioned version of the memory element. During
a write by the head thread, the system performs the write to all
dimensions of the memory element. Note that if the dimensions are
collapsed at this address a single update will update all time dimensions.
It also checks status information associated with the memory element to
determine if the memory element has been read by the speculative thread.
If so, the system causes the speculative thread to roll back so that the
speculative thread can read a result of the write operation.