Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why c is preferred instead of java in most of the real time application [closed]

Tags:

java

c

Why is C preferred instead of Java in most of the real time applications? For example, air-line system. I want some reasons except that Java is little slow.

like image 684
GuruKulki Avatar asked Jan 02 '10 18:01

GuruKulki


1 Answers

There are a number of reasons:

  1. History - the airline system is older than Java. It might need a rewrite, but it's not in progress today that I know of.
  2. Real time generally steers clear of garbage collection, because you can't have the system waiting at a delicate juncture for the GC thread to finish its work. Things have to be more deterministic in real time control situations. This would be true of Java, C#, and any other language that uses GC.

There is a real time version of Java, but I don't know how widely it's used.

I'm not sure that the conclusion of C/C++ always being faster than Java is still true for JDK 6. A lot has changed since the 1.0 version when a lot of the benchmarks were performed (e.g., faster object creation, new memory model, new generational GC algorithms, revised reflection, etc.).

like image 180
duffymo Avatar answered Sep 30 '22 18:09

duffymo