Backwards type analysis of asynchronous method calls
نویسندگان
چکیده
In the distributed setting, the object-oriented programming model may be criticized for its tight coupling of communication and synchronization, found in, e.g., remote procedure calls. Creol is a novel object-oriented language which targets distributed systems by combining asynchronous method calls with so-called processor release points inside concurrent objects [3]. A type system for Creol and a corresponding type soundness result is presented in [4]. Asynchronous method calls complicate the type analysis by decoupling input and output information for method calls, leading to a complex type and effect system [6] to track information during type analysis. Interestingly, the type system can be significantly simplified by backwards type analysis. In this paper, a type and effect system for backwards type analysis and a corresponding type soundness result are presented. We first give a brief summary of Creol’s concurrency and communication model. An object in Creol may be understood as an encapsulated state on which various processes are executed. A process corresponds to the activation of one of the object’s methods. Objects are concurrent in the sense that each object has a thread dedicated to executing the processes of that object, so processes in different objects execute concurrently. The state is encapsulated in the sense that external manipulation of the object state is indirect by means of calls to the object’s method. Only one process may be active in an object at a time; other processes in the object are suspended. We distinguish between blocking a process and releasing a process. Blocking causes the execution of the process to stop, but does not hand control over to a suspended process. Releasing a process stops execution of that process and reschedules control to another (suspended) process. Thus, if a process is blocked there is no execution in the object, whereas if a process is released another process in the object may execute. Although processes need not terminate, the object may combine the execution of several processes using release points within method bodies. At a release point, the active process may be released and a suspended process may be activated. A process which makes a remote method call must wait for the return of the call before proceeding with its activity. In a distributed setting this limitation is severe; delays and instabilities may cause much unnecessary waiting. In an unreliable environment in which communication can disappear, the process can even be permanently blocked (and the object deadlocked). Asynchronous method calls allows the process to be either blocked or released by introducing a processor release point between the invocation of the method and the access to its return values. Release points, expressed using Boolean guards, influence the implicit control flow inside objects by allowing process release when the guard evaluates to false. This way, processes are allowed to choose between blocking and releasing control while waiting for the reply to a method call. Remark that the use of release points makes it straightforward to combine active (e.g., nonterminating) and reactive processes in an object. Thus, an object may behave both as a client and as a server for other objects without the need for an active loop to control the interleaving of these different roles.
منابع مشابه
A New Acceptance Sampling Design Using Bayesian Modeling and Backwards Induction
In acceptance sampling plans, the decisions on either accepting or rejecting a specific batch is still a challenging problem. In order to provide a desired level of protection for customers as well as manufacturers, in this paper, a new acceptance sampling design is proposed to accept or reject a batch based on Bayesian modeling to update the distribution function of the percentage of nonconfor...
متن کاملDynamic Classes: Modular Asynchronous Evolution of Distributed Concurrent Objects
Many long-lived and distributed systems must remain available yet evolve over time, due to, e.g., bugfixes, feature extensions, or changing user requirements. To facilitate such changes, formal methods can help in modeling and analyzing runtime software evolution. This paper presents an executable object-oriented modeling language which supports runtime software evolution. The language, based o...
متن کاملA sound and complete reasoning system for asynchronous communication with shared futures
Distributed and concurrent object-oriented systems are difficult to analyze due to the complexity of their concurrency, communication, and synchronization mechanisms. We consider the setting of concurrent objects communicating by asynchronous method calls. The future mechanism extends the traditional method call communication model by facilitating sharing of references to futures. By assigning ...
متن کاملSecure Implementation of Asynchronous Method Calls and Futures
Programming languages suitable for distributed computation contain constructs that should map well to the structure of the underlying system executing the programs, while being easily usable by the programmers and amenable to computer-aided verification. For object-oriented languages, asynchronous method calls returning futures that will be filled only after the called method has finished its e...
متن کاملReasoning about Asynchronous Method Calls and Inheritance
This paper considers the problem of reusing synchronization constraints for concurrent objects with asynchronous method calls. Our approach extends the Creol language with a specialized composition operator expressing synchronized merge. The use of synchronized merge allows synchronization classes to be added and combined with general purpose classes by means of multiple inheritance. The paper ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- J. Log. Algebr. Program.
دوره 77 شماره
صفحات -
تاریخ انتشار 2008