23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.2 A Brief Language Characterisation 231<br />

Communication Between Process Objects<br />

The grain <strong>of</strong> concurrency in POOSL is the process. Processes communicate by sending<br />

each other messages via channels. When a process wants to send a message it explicitly<br />

states to which channel this message has to be sent. It also explicitly states when and<br />

from which channel it wants to receive a message. Immediately after a message has<br />

been received, the sending process continues its activities (it does not have to wait for<br />

a result). If a process receives a message, it does not execute a method as in traditional<br />

object-oriented languages. Also, a possibly expected result is not automatically returned<br />

to the sender. If a result <strong>of</strong> the message is expected, it has to be transmitted by means <strong>of</strong><br />

another rendezvous.<br />

Methods <strong>of</strong> Process Objects<br />

A process object can call and execute one <strong>of</strong> its methods. This does not require the<br />

reception <strong>of</strong> a message. Methods are comparable with procedures <strong>of</strong> imperative programming<br />

languages such as C or Pascal. However, procedures <strong>of</strong> imperative programming<br />

languages are in general expected to terminate and can therefore only express<br />

finite behaviour. Methods in POOSL, on the other hand, can be used to express infinite<br />

(non-terminating) behaviour. Such infinite behaviour is specified by defining methods<br />

in a (mutual) tail-recursive manner. The concept <strong>of</strong> tail recursion has proven to be<br />

very useful for the specification <strong>of</strong> hardware/s<strong>of</strong>tware systems with complex dynamic<br />

(communication) behaviour.<br />

Internal Data <strong>of</strong> Process Objects<br />

Processes contain internal data in the form <strong>of</strong> data objects (also called travelling objects)<br />

which are stored in instance variables. Data objects are private to the process that owns<br />

them, i.e. process objects have neither shared variables nor shared data. A process<br />

can interact with its data objects by sending messages to them. When a process sends<br />

a message to one <strong>of</strong> its data objects, its activities are suspended until the result <strong>of</strong> the<br />

message is returned by that data object. Data objects themselves cannot send messages<br />

(except for replies) to a process object autonomously.<br />

Parameter Passing <strong>of</strong> Process Objects<br />

When two processes communicate, a message and a (possibly empty) set <strong>of</strong> parameters<br />

is passed from one process to another. The parameters refer to data objects which are<br />

private to the sending process. Because processes do not have any data in common,<br />

it does not suffice to just pass a set <strong>of</strong> references to the data objects, as in traditional<br />

object-oriented languages. Instead, it has to be mimicked that the objects themselves<br />

are passed (whence the term travelling object). This means that a new set <strong>of</strong> objects has<br />

to be created within the environment <strong>of</strong> the receiving process. These objects are (deep)<br />

copies <strong>of</strong> the data objects involved in the rendezvous. The concept <strong>of</strong> travelling object<br />

was first introduced in [Ver92].<br />

Clusters<br />

Next to processes, POOSL supports clusters. A cluster is composed <strong>of</strong> processes and<br />

other clusters and acts as an abstraction <strong>of</strong> these. Clusters are used to create a hierarchical

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!