25.07.2014 Views

VDM-10 Language Manual

VDM-10 Language Manual

VDM-10 Language Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Chapter 16<br />

Threads (<strong>VDM</strong>++ and <strong>VDM</strong>-RT)<br />

Objects instantiated from a class with a thread part are called active objects. The scope of the<br />

instance variables and operations of the current class is considered to extend to the thread specification.<br />

Syntax: thread definitions = ‘thread’, [ thread definition ] ;<br />

thread definition = periodic thread definition<br />

| procedural thread definition ;<br />

Subclasses inherit threads from superclasses. If a class inherits from several classes only one of<br />

these may declare its own thread (possibly through inheritance). Furthermore, explicitly declaring<br />

a thread in a subclass will override any inherited thread.<br />

16.1 Periodic Thread Definitions<br />

The periodic thread definition can be regarded as the implicit way of describing the activities in a<br />

thread.<br />

Syntax: periodic thread definition = periodic obligation ;<br />

periodic obligation = ‘periodic’,‘(’, numeral, numeral, numeral,<br />

numeral, ‘)’, ‘(’, name, ‘)’ ;<br />

Semantics: For each periodic thread four different numbers are used. They are in order of appearance<br />

(also illustrated in Figure 16.1):<br />

1. period: This is a non-negative, non-zero value that describes the length of the time<br />

interval between two adjacent events in a strictly periodic event stream (where jitter =<br />

0)<br />

145

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

Saved successfully!

Ooh no, something went wrong!