06.08.2013 Views

JAVA-BASED REAL-TIME PROGRAMMING

JAVA-BASED REAL-TIME PROGRAMMING

JAVA-BASED REAL-TIME PROGRAMMING

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.

1. Introduction<br />

pany depends on the reliability of the computer system, etc.) special measures<br />

must be taken to limit the possible (faulty) influences of one software function<br />

on another part of the system. Therefore, we have to abandon programming<br />

in C or C++ for large/complex systems. Instead, we have to base the core<br />

development on a more scalable language (and run-time system) that prevents<br />

direct access to memory, for instance via pointers. Java (and partly C#) is<br />

such a language. Still, programming in C is appropriate for device drivers,<br />

which do need to directly access the hardware. For similar reasons of scalability,<br />

Microsoft had to go from their Win32+MFC C/C++-oriented standard to<br />

the Microsoft®.NET Framework with C# in order to stay competitive in the<br />

long run. Here, we will go some steps further, considering also small embedded<br />

systems and severe timing demands.<br />

Java does not solve all problems, and it is not the best possible solution, but<br />

it has the qualities that we need to build higher-level functionality and tools.<br />

Furthermore, it is based on open standards and has the desired support and<br />

(free) availability. However, there is a common misconception in both industry<br />

and academia: The Java language is not suitable for real-time programming.<br />

In the sequel it will be explained why this is not true, and how it can and<br />

should be done.<br />

Given the nice properties of the Java programming language, such as security<br />

and platform independence, we want to exploit the advantages for development<br />

of real-time control software, even for systems subject to severe demands<br />

on performance and predictability. Even though Java from the beginning was<br />

intended for programming embedded control devices, some industrially important<br />

control aspects were never dealt with, and the major development and<br />

success has been within Internet programming of interactive applications such<br />

as applets.<br />

We will approach the real-time issues via established web-programming<br />

and concurrency techniques, which will reveal a few deficiencies of the standard<br />

Java platform. A real-time package (class library) and a few run-time<br />

extensions will be presented. The usage of these additions to create high<br />

performance real-time control software is then described in a real-time programming<br />

chapter which is central the topic of this book. The reader should<br />

then gain additional understanding and programming skill by studying the<br />

remaining chapters about scheduling, processes, and applications.<br />

To illustrate the notions of concurrency, real-time, and control (in the<br />

order mentioned) two simple application examples now follows.<br />

Example 1: The LEGO ® -brick machine<br />

Computer control of a machine for manufacturing LEGO-bricks, as depicted<br />

in Figure 1.1, implies two requirements on the software:<br />

1. The temperature of the plastic material should be measured and con-<br />

12 2012-08-29 16:05

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

Saved successfully!

Ooh no, something went wrong!