|
|
IntroductionThe UNO execution model presented here is rather simple. It is build on four abstractions: threads, method execution steps, method calls, and time. For simplicity (but without loss of generalization), assume a fixed, infinite set of threads. Conceptually, a thread transitions over time from being immaterial, to being active, to being done. See UNO Object Life Cycle Model for related material. An active thread progresses by executing invocations of UNO interface methods. A method invocation is modelled as a (probably infinite) sequence of steps, where each step is either a local computation or a method call. Execution of a method finishes (the method call returns) after all its steps have been executed sequentially. (In practice, the exact sequence of steps of a method invocation will typically not be known until the method invocation is actually executed, but that is irrelevant here.) Initially, there is one active thread; how that thread is started is not covered here. The local computation steps of a method invocation are not covered any further here; they are language-binding dependent. There are four sorts of method call steps:
We will see that invocations of UNO interface methods (normal or one-way) can be modelled as direct calls, synchronous calls, and asynchronous calls. Spawning calls are never used to model interface method invocations. Rather, they can be considered as language-binding–specific extensions. Formal SpecificationFor any set S, let seq(S) stand for the set of arbitrary-length, ordered sequences over S. An element of seq(S) is written as 〈s1, …, sk〉, where k ≥ 0 and each si ∈ S. The notation 〈r1, …, rj〉 • 〈s1, …, sk〉 := 〈r1, …, rj, s1, …, sk〉 represents concatenation. Let Step := DirectCalls ∪ SpawningCalls ∪ AsyncCalls ∪ SyncCalls be the disjoint union of all possible method calls (local computation steps can be ignored here). A method call is recursively represented as the sequence of method call steps that constitute the method invocation; that is, DirectCalls, SpawningCalls, AsyncCalls, SyncCalls ⊆ seq(Step). Let Th be a fixed, infinite set of threads. Information about threads that changes over time is encoded by the following functions that depend on time t:
Initial state:
Transitions:
The invocation of a normal (not one-way) UNO interface method can be modelled as either a synchronous call or a direct call. Modelling it as a synchronous call is preferred (to maintain the general properties of asynchronous calls, see below), but there can be cases where a direct call is chosen for performance reasons. For example, method invocations within one language binding are often implemented as direct, language-binding–specific function calls, which can be very fast. The invocation of a one-way UNO interface method can be modelled as an asynchronous call, a synchronous call, or a direct call. Modelling it as an asynchronous call is generally preferred. Again, modelling it as a direct call is mainly allowed to exploit performance advantages for intra–language-binding calls. Allowing to model it as a synchronous call appears to be a natural consequence of allowing to model it as a direct call. ProblemsIdeally, invocations of normal UNO interface methods would always be modelled as synchronous calls, and invocations of one-way UNO interface methods would always be modelled as asynchronous calls. Additionally allowing weaker calls (direct calls for normal method invocations, synchronous and direct calls for one-way method invocations) has some undesirable consequences:
|



