JAVA-BASED REAL-TIME PROGRAMMING
JAVA-BASED REAL-TIME PROGRAMMING
JAVA-BASED REAL-TIME PROGRAMMING
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Timing 2:<br />
A: Read 5000<br />
B: Read 5000<br />
A: Amount = 5000 - 1000<br />
B: Amount = 5000 + 10000<br />
A: Write 4000<br />
B: Write 15000<br />
// Timing 2:<br />
A: Read 5000<br />
B: Read 5000<br />
B: Amount = 5000 + 10000<br />
B: Write 15000<br />
A: Amount = 5000 - 1000<br />
A: Write 4000<br />
Figure 1.3: Execution of the two bank account transactions interleaved in two<br />
different ways. With the Timing 1, the resulting amount is 15000, but the<br />
result happens to be 4000 in the second case. Hence, the final results are<br />
wrong and vary from time to time, which is clearly not acceptable.<br />
Book outline<br />
In the next chapter, we will go though the fundamentals of program execution<br />
with special interest in the concurrency issue and in the properties of the<br />
Java language. In Chapter 3, the Java language is used for solving concurrent<br />
programming problems. Doing that, however, also reveals some deficiencies of<br />
the standard Java platform and classes. Therefore, in Chapter 4, additional<br />
classes supporting real-time programming will be presented. Then in Chapter<br />
5, we will learn how to do real-time programming using the classes from<br />
Chapter 4.<br />
15