java停止1s_〜1s延迟控制应用程序:这适用于Java吗?

在我的工作中,我们最近完成了控制应用程序的系统架构,其最大延迟大约为一到两秒.它分布在通过IP LAN进行通信的小型ARM片上盒中.

我们最初预见到我们会使用C或C,因为它是一种经典的控制系统语言.在讨论了如何实现应用程序之后,我们现在意识到C具有相当有限的库,缺乏内省,并且具有可能减慢开发的一些其他属性.我的同事随后建议Java可能会胜任这项工作.

我真的害怕为控制应用程序运行GC的延迟,我也不愿意放弃RAII,因为应用程序将使用大量外部资源(套接字,文件句柄,外部库等句柄等).

pro / con列表目前如下:

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

如果GC延迟不成问题,我很乐意使用Java,我们可以获得RAII.因此

我也研究了其他有RAII并且可以作为替代品的langs,到目前为止我发现D,Ada,VB,Perl,Python(C),PHP,tcl和Lua似乎有某种超出范围的回调.我的自然反应可能是D,Python和ADA可能适合控制应用程序. D和ADA是我的最爱.

所以,我的问题是:你有什么建议吗? Java是一个可行的选择,如果你可以选择任何语言,它会是什么?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值