====== State vector ====== A state vector lets one process actively read the state of another. It is non-blocking and unbuffered: the reader gets whatever value is set at the moment of reading, and the process being read does not have to send anything. The state of a process is the step it is currently on, together with the values of those of its variables that can be read from outside. Unlike a message in a [[data_stream_vector|data stream]], the state can be read any number of times and stays the same until its owner changes it. In the clerk model, this is a sign on a clerk’s desk that other clerks can look at. We draw it as a diamond. ===== Example ===== Program has two entities, the instance of some class "A" and the function "f", defined as follows: Class A: val_a = instance = A() func f(x, y): ... z = instance.val_a + ... ... return z The effect of changing value ''val_a'' propagates only when function ''f'' reads changed value. On the diagram this connection described like that: digraph SV { rankdir=LR instance_a[shape=box label=A] val_a[shape=diamond fixedsize=true label="a"] f[shape=box] instance_a -> val_a -> f }