Wednesday, October 17, 2018

Developing software in real time with Java SE API

Real-time software

Unlike traditional business applications, real-time software is expected to provide results under very strict time constraints. A computation that runs at the wrong time - too early or too late - is considered incorrect, even if the calculated numbers are exactly correct. In the context of this article, the term software in real time means software designed to meet restrictions in real time.

In other contexts, the term software in real time is occasionally used to describe interactive software with a human user. Real-time stock quotes, for example, can be delivered on your computer screen as soon as your application is written. However, unless the provider of its stock quotes has taken precautions to ensure that the quote displayed on its screen is not greater than a certain number of milliseconds (ms), the use of the term is different from how the term is used. in this article.

Real-time software engineers usually make a distinction between real-time runtime systems and runtime systems. For the purposes of this series, rigid real-time systems follow a software engineering approach that requires that all compliance with time constraints be validated prior to the execution of the software system. In other words, the engineer proves that the rigid application in real time will satisfy all time constraints, carefully analyzing the worst case execution paths for each task, analyzing the worst execution moments of each machine instruction in each worst execution case. (including delays resulting from cache errors and pipeline stops associated with the containment of processing resources) and ensuring lower limits on the separation of time between consecutive trips of each task.

Systems that are designed according to the discipline in real time do not need to verify in execution time if deadlines are lost. However, real-time methodologies are extremely inefficient in most modern computing platforms. This happens because it is very difficult to prove that moderately complex software will always benefit from the memory cache, speculative execution and pipelining optimizations that are projected on modern hardware platforms. Thus, the very conservative and programmed real-time system often ends up using less than 5% of the total speed capacity observed in the hardware platform.

Soft real-time systems, on the other hand, follow an approach in which the execution times and task execution frequencies are analyzed more through empirical techniques (measurements and statistical characterizations), and the software itself is written to accommodate the possibility that temporary restrictions are forgotten.




Interested in Java training? Join now: "java training in chennai "

Java SE versus other languages

The use of the Java SE API in the implementation of real-time systems is more appropriate for real-time development. The use of Java SE for real-time development is also possible, but generally requires the use of more specialized techniques, such as the use of NoHeapRealtimeThread abstractions, as described in the real-time specification for Java (JSR 1), or the use of a slightly simpler abstractions of ManagedSchedulable from the critical security specification of Java technology (JSR 302).

It is also important to distinguish engineering in real time, as described in this series, from performance engineering. An e-commerce web server, for example, may have been carefully designed to support an average of 1,000 transactions per second. This is different from saying that all transactions must be completed in 1 ms. It may be that some transactions require hundreds of ms and others have been completed in less than 1 ms, as long as the average of all transactions is 1 ms. This can also mean that each transaction requires an average of 4 ms from start to finish, but the system has the ability to simultaneously execute four transactions at a time.

The benefits of the Java language are especially valuable in real-time applications that are large, complex and dynamic. Software engineers are motivated to select Java SE when their projects require dynamic code updates, coordination among various developer teams, integration of independently developed software components, compatibility with multiple hardware or operating system platforms, or compatibility with multiple software configurations according to the requirements of the product they evolve. several years or even decades.

Projects that can be fully implemented by one or two developers in a year are more likely to be implemented in a less powerful language, such as C or C ++, especially if it is critical that the final product minimize the battery's energy consumption or high volume. production costs. Such projects are less likely to appreciate the benefits of Java and can often justify the higher software engineering and maintenance costs associated with the option of using an older language.




No comments:

Post a Comment

From Java 8 to Java 11

Switching from Java 8 to Java 11 is more complicated than most updates. Here are some of my notes on the process. Modules Java 9 i...