An Object-Oriented View of Action Systems

Action systems are used in chapter 2 to represent a message communicating process (Merge), a fragment of an operating system (mutual exclusion), a process controller (odometer), and even solutions to combinatorial problems (gcd, shortest path). The syntax

  • PDF / 1,985,506 Bytes
  • 18 Pages / 439.37 x 666.142 pts Page_size
  • 24 Downloads / 230 Views

DOWNLOAD

REPORT


3.1

Introduction

Action systems are used in chapter 2 to represent a message communicating process (Merge), a fragment of an operating system (mutual exclusion), a process controller (odometer), and even solutions to combinatorial problems (gcd, shortest path). The syntax and semantics of action systems are sparse, yet we developed succinct programs for several well-known problems. This chapter extends the programming model of chapter 2 to make it easier to describe process interactions. Additionally, we address the issue of program composition in some detail. The typical mode of process interaction in chapter 2 is through shared variables. For instance, in the odometer example of section 2.4.2, a boolean variable cO is shared by the odometer with its environment. The environment sets cO to true to indicate that the value of the odometer should be incremented, and the odometer program sets cO to false on completion of the incrementation. In this chapter, we eliminate shared variables altogether, replacing them with "remote procedure calls". Thus, the odometer program will include a procedure for incrementation that can be called by its environment. Fortunately, a procedure is quite similar to an action, so we need to extend the model of action systems only minimally to accommodate procedure calls. We designate certain actions in a box to be methods, and methods can be executed ol}-ly when called. A box resembles an object in object-oriented programming, though it may include actions - which are executed autonomously, as before- in addition to the methods. J. Misra, A Discipline of Multiprogramming © Springer Science+Business Media New York 2001

40

3. An Object-Oriented View of Action Systems

There is a fundamental issue related to method calls. In wide-area computing, in particular, a caller should not be made to wait indefinitely (i.e., for an unbounded number of computation steps); if there is no guarantee that the method can be executed successfully to completion, the call should be rejected. This is in contrast to current practices in concurrent computing where a process that requests a resource is made to wait, perhaps forever, if the resource is not available. Guaranteed termination of a method call is an essential requirement of our theory; we insist that execution of every action terminate, and this requirement can be met only if every method called by an action is also guaranteed to terminate. This model of programming is called Seuss. Seuss is basically an action system with a minimal amount of additional machinery to facilitate interactions among its components. Our examples in this chapter and the next attest to the effectiveness of this model of programming on a variety of computing problems.

Overview of the model We use the box construct from chapter 2 that plays the role of an object. As before, a program consists of a set of boxes, though there are no shared variables. Typically, a user defines generic boxes, called cats (cat is short for category), and creates several boxes from each cat thr