Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Garbage collection and Threads

Status
Not open for further replies.

munnanext

Programmer
Aug 20, 2004
49
US
Hi, I am reading the following lines in some Book. This looks strange to me. Is this correct ? Can you pl explain me what is "Vendor Implemented" and why Java is not suitable for real time Programming ? Thanks

The garbage collection algorithm in Java is vendor implemented Threading and garbage collection are two of the few areas that are platform dependent. This is one of the
reasons why Java is not suitable for realtime programming. It is not a good idea use it to control your
plane or nuclear power station. Once an instance of the Integer class has a value it cannot be changed.

 
Vendor Implemented: The company who wrote your JVM is responsible for writing the garbage collection routines. Since the JVM is hardware-specific, and the hardware vendor is usually the one writing it, the garbage collection has to be specific to the hardware. So what they're saying is that while Sun provides a reference implementation for a limited number of platforms (Solaris, Win32), they aren't going to write the GC code for every platform. Even on the platforms they do support, other vendors might have better implementations.

Not suitable for RealTime programming: Realtime means that everything has to happen in a deterministic time. In other words, when an external event happens, your program has to respond immediately, not 100ms later. If something can step in and consume time at what is essentially random intervals, the requirement for realtime systems is not satisfied, and thus GC languages (like Java and .NET) are not suitable for realtime applications.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks for your valuable postings. Pl ignore my last sentense "Once an instance of the Integer class has a value it cannot be changed".

Thanks
 
Just a comment.

Don't lose your hopeness. RT Java research is really advanced at this time, and I think that we will have releases of this soon.

And I've read about some Java implementations for scenarios like submarines where real time is necessary.

Cheers.

Dian
 
Another comment I suppresed in my first answer:

Most people don't run RT-operation-systems, so java-RT-implementations for windows, mac, or standard-linux will not happen soon.

AFAIK a RT-system needn't respond in a time less than a standard-interval, but only guarantee to respond in a defined interval.

Therefore a RT-system might be really slow, compared to a classical, non-RT-OS - it only needs to guarantee to be in no circumstances slower than XY.
I don't know in which way this affects threads - since every thread consumes some time, this has to limit the number of threads drastically.

Or the RT-specification is a one-thread specification, and you have to calculate your needs for threads and response-time yourself.

seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top