简体   繁体   English

实时Java互操作性

[英]Real-time Java interoperability

I am wondering how it's the interoperability between JRE6 and the JVM from rtsj . 我想知道它是如何JRE6从JVM之间的互操作性RTSJ It seems that I have to use only their implementation (since the code will be interpreted using their JVM), so I cannot use many of the features that Java 6 has to offer. 似乎我只需要使用它们的实现(因为代码将使用其JVM进行解释),因此我无法使用Java 6必须提供的许多功能。 Can it support a GUI? 它可以支持GUI吗? (say for example to modify the parameters of an industrial process). (例如修改工业过程的参数)。

I might be wrong, hoping to get some feedback from you. 我可能是错的,希望从您那里得到一些反馈。

Also, it seems that are more real time implementations for Java. 另外,似乎是Java的更实时实现。 Which one did you use and which one did you like most? 您使用了哪一个,最喜欢哪一个?

In order to provide real-time behavior, the JVM needs to be very specifically engineered. 为了提供实时行为,需要对JVM进行特别的设计。 This includes integration at the operating system level to get access to real-time scheduling features of the host OS. 这包括在操作系统级别进行集成,以访问主机OS的实时调度功能。

The Sun rea-time JVM is compatible with J2SE5, for instance. 例如,Sun实时JVM与J2SE5兼容。 http://java.sun.com/javase/technologies/realtime/faq.jsp#4 http://java.sun.com/javase/technologies/realtime/faq.jsp#4

Generally, any specialized instance of a system (OS, JVM, etc) that offers niche functionality, like security or real-time behavior, tends to be a release behind the general purpose version. 通常,提供利基功能(例如安全性或实时行为)的系统的任何专用实例(OS,JVM等)都倾向于在通用版本之后发布。

As to using a GUI for real-time, you should investigate using 2 tier client-server control of the real-time process using something like JMX, RMI or web-services (whichever is the lightest-weight). 至于使用GUI进行实时处理,您应该研究如何使用JMX,RMI或Web服务(以最轻者为准)之类的实时过程使用2层客户机/服务器控制。 Using a GUI directly in real-time code seems like it could introduce lots of potential problems for the application as it tries to execute withing real-time constraints. 直接在实时代码中使用GUI似乎会给应用程序带来很多潜在的问题,因为它试图在实时约束下执行。

See my answer to another question for some more examples of RTSJ commercial-grade implementations. 有关RTSJ商业级实施的更多示例,请参见我对另一个问题的回答 The latest version (2.1) is compliant with JDK1.5, so you should have Swing/AWT available. 最新版本(2.1)与JDK1.5兼容,因此您应该具有可用的Swing / AWT。

While it is feasible to write a GUI to execute within the same JVM as real-time processes, it's not clear that this is a good architectural decision. 尽管编写GUI与实时进程在同一JVM中执行是可行的,但尚不清楚这是否是一个好的架构决策。 It is more likely that you'd prefer to isolate the real-time behaviors in a JVM and provide a separable interface that implements to GUI in a separate memory space. 您更可能希望隔离JVM中的实时行为,并提供可分离的接口,以在单独的内存空间中实现GUI。

In principle, you are supposed to be able to write RTSJ code such that it runs in the same JVM with non-real-time threads (and I have done a lot of this) but it can be tough to get synchronization right. 原则上,您应该能够编写RTSJ代码,使其能够在具有非实时线程的同一个JVM中运行(并且我已经做了很多工作),但是很难正确地进行同步。

由于本书描述,可以有互操作性的Sun Java的JRE和RTSJ实现之间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM