20.01.2015 Views

The TASM Language Reference Manual Version 1.1 - Synrc

The TASM Language Reference Manual Version 1.1 - Synrc

The TASM Language Reference Manual Version 1.1 - Synrc

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.

Clearly, the overlap of update sets will most likely lead to multiple consistency<br />

violations if granularity is coarse and care is not taken into the design of the steps.<br />

However, the consistency violations should yield insight into the parallelism and timing<br />

characteristics of the application being studied. This insight will be preserved as<br />

granularity is increased. <strong>The</strong> use of the next keyword in specifications changes meaning<br />

slightly in the case of parallel machines. In the multi-agent case, the next keyword<br />

means that a machine waits for a move by another agent, regardless of whether or not<br />

the move affects the given machine’s execution.<br />

Parallel composition also introduces contention between machines for resource<br />

consumption. In the <strong>TASM</strong> language, no machine is preempted from using a resource.<br />

However, if the resource is exhausted, an exception is thrown and results in update set<br />

inconsistency. <strong>The</strong> shared resource model is simple and useful to model many resource<br />

types.<br />

Concurrent resource usage is assumed to be additive. For example, if, in a time<br />

interval, two different machines use the same resource (in amounts r 1 and r 2 respectively),<br />

the total amount used would be r 1 + r 2 .<br />

Formally, we introduce the ⊙ operator to denote the parallel composition of two<br />

update sets produced by two main machines that yield update sets with different durations:<br />

• Update set by machine 1: T RU1 = (t1, RC1, U1)<br />

• Update set by machine 2: T RU2 = (t2, RC2, U2)<br />

• State when update set is produced: T RS i = (gt i , RC i , S i )<br />

• if t1 = t2<br />

– Combined update set: T RU = T RU1 ⊙ T RU2 = (t1, RC1 + RC2, U1 ∪<br />

U2)<br />

– T RS i+1 = T RS i ◦ T RU = (gt i + t1, RC i + RC1 + RC2, S i ⊙ (U1 ∪<br />

U2)<br />

• if t1 > t2<br />

– Combined update set: T RU i = T RU1 ⊙ T RU2 = (t1, RC1 + RC2, U1)<br />

– Combined update set: T RU i+1 = T RU1 ⊙ T RU2 = (t2 - t1, RC1, U2)<br />

– T RS i+1 = T RS i ◦ T RU i = (gt i + t1, RC i + RC1 + RC2, S i ⊙ U1)<br />

– T RS i+2 = T RS i+1 ◦ T RU i+1 = (gt i + t2, RC i + RC2, S i+1 ◦ U2)<br />

• if t1 < t2<br />

– Combined update set: T RU i = T RU1 ⊙ T RU2 = (t2, RC1 + RC2, U2)<br />

– Combined update set: T RU i+1 = T RU1 ⊙ T RU2 = (t1 - t2, RC2, U1)<br />

– S i+1 = T RS i ◦ T RU i = (gt i + t2, RC i + RC1 + RC2, S i ◦ U2)<br />

– S i+2 = T RS i+1 ◦ T RU i+1 = (gt i + t1, RC i + RC1, S i+1 ◦ U1)<br />

26

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

Saved successfully!

Ooh no, something went wrong!