Execution Sequences

Execution sequences are a convenient representation for concurrency. Table 5-1 is a textual version of what an execution sequence looks like.

Table 5-1. Execution sequence
Task1 Task2
sort(a) sort(b)
getInput() doOutput()
load x int t1  
 load x into t2
add 1 to t1 add 1 to t2
store t1 into x  
 store t2 into x

If the order of execution of Task1 and Task2 does not matter or if they actually execute concurrently, they can appear in the same row. When ordering between two tasks matters, they do not share a row.

In the previous example, Task1 and Task2 both do sorts, then Task1 does input and Task2 does output. The order of those operations does not matter, except that the execution sequence asserts that Task1 finishes receiving ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.