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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

In general complex systems require a mix <strong>of</strong> styles corresponding to a mix <strong>of</strong> implementation<br />

technologies. The idea to connect all objects to one channel as we suggested for<br />

s<strong>of</strong>tware is a not very realistic extreme that gives little structure to a model. In general<br />

we need a mix <strong>of</strong> system parts with different dynamic properties. Some system parts are<br />

statically interconnected and active when the system is active. Other parts are needed<br />

dynamically. We would like to create them and remove them.<br />

6.6.8.6 Mimicking Process Creation<br />

A POOSL model describes dynamic behaviour <strong>of</strong> a future implementation in for instance<br />

hardware or s<strong>of</strong>tware. The semantics <strong>of</strong> POOSL are defined in terms <strong>of</strong> an operational<br />

model. One <strong>of</strong> the aspects is that the operational model explains how a system is instantiated.<br />

Instantiation is a hierarchical construction process that in general will start<br />

from a single cluster. For details see Chapters 8 and 9. Process objects, clusters and<br />

channels <strong>of</strong> a system are instantiated as static structure. This structure is predetermined<br />

at ’compile-time’. When we decide for an implementation in hardware this instantiation<br />

approach is natural. A hardware structure simply exists before the system starts executing.<br />

For s<strong>of</strong>tware, however, it would be convenient to have a notion <strong>of</strong> process creation.<br />

We do not <strong>of</strong>fer this explicitly. A system is always initiated with a static number <strong>of</strong><br />

process objects and clusters. However, there is a way to mimic process creation. A process<br />

can be claimed from a stock <strong>of</strong> processes when it is needed. Subsequently it can be<br />

released which means that it is added to the stock again when its use is finished. This<br />

approach requires instantiation <strong>of</strong> at least the maximum number <strong>of</strong> processes that is ever<br />

needed simultaneously. Processes can be claimed and released if their internal behaviour<br />

is constructed properly. These processes must be dynamically linked temporarily to<br />

other processes that require the services they <strong>of</strong>fer.<br />

An example <strong>of</strong> a piece <strong>of</strong> behaviour that mimics process creation is the following<br />

initial method call<br />

free<br />

instance methods<br />

free<br />

a?claim(requestorId);<br />

a!granted(requestorId,myId);<br />

claimed abort (a?release(id1,id2 id1=myId and id2=requestorId); free)<br />

claimed<br />

’Space for the specification <strong>of</strong> all services <strong>of</strong>fered.’<br />

The previous behaviour description can be part <strong>of</strong> the class description <strong>of</strong> the objects<br />

in a multiple. It can be used to claim and release an object <strong>of</strong> such a multiple. Any<br />

object <strong>of</strong> the multiple is connected to channel a and can receive a claim message if it<br />

is free. With the claim message the object receives the identifier <strong>of</strong> the sender denoted<br />

as requestorId. The object uses this identifier as destination indication in its reply and<br />

puts its own identifier myId in this reply. The object is then claimed and can perform<br />

its normal course <strong>of</strong> behaviour. This course <strong>of</strong> behaviour is modelled by the method

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

Saved successfully!

Ooh no, something went wrong!