~ 1s delay control application: is this applicable to Java?

In my work, we recently completed the system architecture for controlling applications, with a maximum delay of about one to two seconds It is distributed in a small arm on - chip box communicating through IP LAN

We initially anticipated that we would use C or C because it is a classical control system language After discussing how to implement the application, we now realize that C has a fairly limited library, lacks introspection, and has some other properties that may slow down development My colleague then suggested that Java might be qualified for the job

I'm really afraid to control the delay of running GC in the application, and I'm not willing to give up raii, because the application will use a lot of external resources (sockets, file handles, external library handles, etc.)

The Pro / con list is currently as follows:

C++

+ RAII - Easy resource management - it will be a complex system
+ System language - speed if we cant't find a JIT VM for our ARM
+ No GC - no big worst case latencies from the GC
+ Easy to integrate with some shared mem libs that we have to interface with
- Fewer free as in beer libs 
- Lacks introspection - Mapping classes to DB and external data formats (XML)    
  would benefit from this (ORM /JAXB) approach
- Easy to shoot one self in the foot - hard and expensive to find programmers 
  which don't make big mistakes
- Memory fragmentation - needs tuning and workarounds

Java

+ Huge amount of libs
+ Introspection - serialization becomes a breeze (see C++ section)
+ Easier to find 'good enough' programmers
- No RAII - Client has to remember finally or you leak 
   resources. IMO Java programmers tend to ignore this 
   problem unless they have server app background.
- No System Language - possibly slower although ARMj Could alleviate this
- GC - latency might go up (don't kNow if parallel GC will work - seems that
     you might get fragmentation,see note below).
- Need to write JNI for the shared mem libs that we interface with
- Maybe ORACLE will eat us

Memory fragmentation using parallel GC is mentioned in this amd article

If GC latency is not a problem, I'm happy to use Java. We can get raii Therefore, I have also studied other Langs with raii and can be used as alternatives. So far, I have found that D, ADA, VB, Perl, python (c), PHP, TCL and Lua seem to have some out of range callbacks My natural reaction may be that D, Python and ADA may be suitable for controlling applications D and ADA are my favorites

So my question is: do you have any suggestions? Java is a viable option. If you could choose any language, what would it be?

Solution

GC is only used to reclaim memory from obsolete objects Discard very few resources and you will get very few, shorter GC

You may use a lot of sockets, handles from external libraries, but how fast do you discard them?

The complete GC is designed to remove debris It uses it continuously by copying all memory That's why it's expensive, so if delays are important to you, you want to minimize them That is, if your full GC takes more than 100 milliseconds, there will be serious performance problems It shouldn't be so high

With all due respect, I say you should be able to develop a control system with a delay much less than 10 milliseconds, 99% of the time

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>