From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2a15f832a31a89af X-Google-Attributes: gid103376,public From: Roy Grimm Subject: Re: who said Java can't be used for realtime ! Date: 1998/11/30 Message-ID: <3662E25E.D8F60848@collins.rockwell.com>#1/1 X-Deja-AN: 417184754 Content-Transfer-Encoding: 7bit References: <73l99p$t3o@drn.newsguy.com> Content-Type: text/plain; charset=us-ascii Organization: Rockwell Collins, Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-11-30T00:00:00+00:00 List-Id: bill_k@moonlight_entreprise.nospam.com wrote: > > see http://www.java.sun.com/features/1998/11/fishtank.html > > about 60% into the above page we read: > > "Even for a real-time system, it was better to let the system just > garbage collect when it needed to instead of trying to predict when > you thought it was a good time. The system just responded better that > way." > > OK, so this is it. Java can also do realtime just fine, even with GC ! > > any rebuttle from the Ada fans? > > bill. Hmmm... Nice demo. Works well having virtual fish swimming around randomly. Not too demanding. Of course, you have to take into consideration that the program probably runs on a system that has quite a bit more processing horsepower than it needs and it probably only reacts to a few simple inputs from a keyboard (or other similar input device). And really, what happens when the program gets delayed a few hundred miliseconds when the garbage is collected? Not much. Now, consider trying to implement a program in Java with said garbage collection in another environment. You need to make a weather radar for a plane that detects windshear realtime and announces that windshear as soon as it's detected so the pilot can take appropriate action. If you don't report windshear fast enough, the plane can crash into the ground, killing hundreds of people. Oh, but that's not all. There are significant weight, space, power consumption and heat generation restrictions placed on the computer you have to build to run your software. This is a very real consideration when you factor in all the electronics in an airplane and how much power they consume in both electricity and heat dissipation needs. So, your hardware guys use old generation processors that weigh less, use less electricity and generate less heat. Unfortunately for you, they're not the speed demons that run in today's PCs and high end workstations. But wait, there's more. The same restrictions for the processor apply to everything in the system. You have less program space, less RAM and no hard drive. Now you have to write a program whos size is measured in kilobytes instead of megabytes. And your heap space is usually minimal, if it exists at all. Now, I know what you're saying. You're not so sure full blown Java can perform under these circumstances. But we're just getting started. You get to write all your software so that it passes RTCA D0-178B Level A certification. That means that every line of code has been linked to design documentation and the corresponding requirements. And, you get test every line of code using full MCDC coverage so that you know for a fact that every reqirement is fullfilled and no unexpected behavior is evidenced. For this kind of coverage, there can be little non-deterministic behavior in your code. This includes most recursion (that which exists must be finitely bounded), dynamic allocation, and yes even garbage collection. 'cause that 200 milisecond delay may be fine for virtual fish but when you've got strict timing requirements in handling data, you don't have time to stop every once in a while to collect garbage. There is a very real possibility that you could miss something important. Important enough to cause a critical failure. O.k. I recognise that most applications are not written under these strict guidelines. If you've got a fast enough processor, enough RAM, and loose enough requirements for your software, Java with garbage collection would work in real time. Also, I do know of an embedded Java processor that is being targeted for the avionics industry. I haven't used it personally but I understand it's missing some of the non-deterministic features of the language so that you can use it in a safety critical environment. What it boils down to is that there is no one tool that will fit in every situation. Yes Java would work in real time in specific situations. In others, it wouldn't work at all. Ada is a fine language for doing many tasks but it's not the best for every task. Would you have only one tool in a tool box? Certainly not. While a crescent wrench works well as a wrench and can substitue as a hammer in a pinch, it's wholly inadequate for turning screws or chopping wood. So too Java, Ada, C/C++, Eiffel(did I spell that correctly?), assembler, Perl, Tcl, COBOL, Lisp, Prolog, etc. ad nauseum each do well at particular tasks. They each can do things the others can, but they each excel at a particular specialty. Would you write an operating system in COBOL? Would you write a database server in assembler? I certainly wouldn't. Just my two cents Roy A. Grimm My views do not necessarily represent those of my employer.