| # Section 7.1.3: $ATTACH |

###### abstract class $ATTACH < $LOCK

#### Formal Definitions

This abstract class defines a state component which is a set of every class sub-typing from this class. Note that SAME has to be an instantiated class, not an abstract one.

types
SAME = object_type ;
$ATTACH = set of object_type
state attachments : $ATTACH
inv att_types ==
forall obj in set att_types & sub_type($ATTACH,obj)

NOTE | See the important note about vdm state in the notes on vdm-sl usage in this specification.

This pervasive abstract class is a particular kind of $LOCK which, in addition to those definitions inherited from that abstract class, defines birth, death and synchronise. These features are related to the concept of a cluster which is part of the Sather language, hence the need for this pervasive class.

#### birth

This feature is provided to associate the invoking thread with a set of clusters in the current execution envionment. Being dependent upon the environment in which the program is executing, it is not possible to define the meaning any more precisely than that given in the definitiion below

birth

##### Formal Signature

birth(self : SAME)

This feature attaches the thread which invokes it to a member of the set of clusters in the current execution computer system environment.

#### death

This feature removes the calling thread from the cluster corresponding to this 'attach' object. Since the implementation of a cluster is entirely dependent on the execution environment it is not possible to specify the semantics any more precisely than in the definition given below.

death

##### Formal Signature

death(self : SAME)

This feature detaches the thread which invokes it from the cluster in the current execution computer system environment to which it was attached. If the thread is not attached to any cluster on invocation then nothing needs to be done.

#### synchronize

This call may be used as an alternative to the synch statement in the language. Its purpose is to synchronize all remote/local object states throughout the program.

synchronize

##### Formal Signature

synchronize(self : SAME)

This feature synchronizes the thread invoking this feature with all other threads on other clusters by blocking until all objects have consistent states across clusters.

| Language Index |  | Library Index |  | Section 7 Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Thursday, 18 May 2000. |