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.

172 Modelling <strong>of</strong> Concurrent <strong>Reactive</strong> Behaviour<br />

also on the state <strong>of</strong> the buffer. An empty buffer cannot perform a rendezvous with the<br />

receiver.<br />

Buffered communication requires special attention for a situation where a buffer is full.<br />

We have to decide whether or not we accept loss <strong>of</strong> information. If there are one or more<br />

messages in a buffer, we can identify various situations.<br />

1. The buffer stores an infinite number <strong>of</strong> messages, and keeps them available for the<br />

receiver.<br />

2. The buffer stores a finite number <strong>of</strong> messages, and keeps them available for the<br />

receiver. So the buffer may become full. We can discard either:<br />

a) the new message arriving at the full buffer, or<br />

b) the oldest message in the buffer.<br />

3. A special case <strong>of</strong> a finite buffer is a one place buffer. It has the same discard options<br />

as in case 2.<br />

We can specify the sort <strong>of</strong> buffered communication by adding symbols to a buffer. The<br />

symbols ¥ n¥ 1 model respectively cases 1,2 and 3, as is shown in Figure 6.8. All sorts can<br />

be modelled straightforward in POOSL. A buffer object with the appropriate behaviour<br />

must be defined. We can also specify the possible forms <strong>of</strong> discard messages graphically.<br />

Figure 6.9 shows the use <strong>of</strong> an additional curved arrow to visualise the discarding <strong>of</strong><br />

messages. In case a) a new message arriving at the full buffer will be discarded, and in<br />

case b) the oldest message in the buffer will be discarded at the arrival <strong>of</strong> a new message.<br />

A guideline for modelling the behaviour <strong>of</strong> buffers is that the buffer should be active<br />

together with the sender. A buffer can be modelled as a separate process object in the<br />

POOSL description. We must guarantee that the buffer can always respond to a message<br />

from the sender, so that the rendezvous is finished always. We recommend to cluster a<br />

buffer object at the sender side. The receiver may or may not wish to communicate with<br />

the buffer.<br />

So far we modelled an asynchronous flow with the premise that the sender can always<br />

perform its rendezvous. Consequently we needed a discard mechanism when the<br />

n-place buffer is full. An alternative approach is that the buffer does not finish the<br />

rendezvous when it is full. Both alternatives can be used as an approximation for an<br />

infinite buffer. The designer is responsible to make the buffer large enough. In general<br />

we recommend to define a warning to notify that a buffer is full or that a message has<br />

been discarded.<br />

From our modelling experience so far we have the impression that we do not need<br />

asynchronous communication so <strong>of</strong>ten in a specification on system level. We can model<br />

a lot <strong>of</strong> situations with asynchronous concurrent process objects that communicate synchronously.<br />

On the lower levels <strong>of</strong> abstraction (the extended behaviour modelling) we<br />

will need asynchronous forms <strong>of</strong> communication, such as a handshake protocols, more<br />

<strong>of</strong>ten.

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

Saved successfully!

Ooh no, something went wrong!