Real-time Java, Part 5: the preparation and deployment of real-time Java applications
Level: Intermediate
Caroline Gough (goughc@uk.ibm.com), software engineers, IBM
Andrew Hall (andhall@uk.ibm.com), software engineers, IBM Hursley Lab
Helen Masters (helen_postlethwaite@uk.ibm.com), software engineers, IBM Hursley Lab
Alan Stevens (alan_stevens@uk.ibm.com), software engineers, IBM Hursley Lab
July 11, 2007
This article is to discuss the six-JavaT ™ part series of articles in Part 5, and has demonstrated how to use IBM WebSphere Real Time with the tools to prepare and deploy real-time Java applications. The author used examples of applications, and has demonstrated to control garbage collection suspended Metronome refuse collection, to avoid run-time compiler for the suspension of pre-compiler (Ahead-of-time compiler), as well as to meet the most pressing time
NoHeapRealtimeThreaddemand.
Before this series of several articles on the IBM WebSphere Real Time how to solve the problem of uncertainty, thus the timescale was very low value (delay value). This feature will be the Java platform and the scope of expansion to the original receipts only apply to specific real-time (RT) programming languages (such as Ada) in the field. RT hardware and operating systems are often customized, incomprehensible. With different WebSphere Real Time running on the IBM BladeCenter ® LS20 compatible (see references) and similar hardware on the Linux ® RT version. It supports the typical RT application requirements:
- Low: to ensure that in the limited time response signal.
- Certainty: There is no garbage collection (GC) suspended indefinitely.
- Predictable: thread priority implementation of the frequency of monitoring, implementation time line.
- No priority inversion: high-priority thread not in the priority thread is running, its been a lock for the low priority thread obstruction.
- Physical memory of the visit: such as device drivers such as RT always require retroactive application root.
This article demonstrates how to use WebSphere Real Time provides the tools to prepare and deploy RT Java applications. Cited in the text before the article of this series, to demonstrate how to make the process to a higher level of uncertainty RT implementation. (This could be helpful, but before reading the article is not necessary.) You will see how to use a strategy RT GC (Metronome) in WebSphere Real Time attached Lunar Lander examples of applications in improving the predictability. You will also learn how to pre-compiler (AOT) your application, in order to improve the environment of an RT uncertainty. Finally, you will not refuse collection for the use of the control of the design and realization of a memory RT applications, found your RT Java applications to maximize the effectiveness of tips and techniques.
If you want to run this paper, certain procedures - of course, it is best to prepare your own RT Java applications - then you need to visit an installed WebSphere Real Time System (on access to the technology more information, See references).
NoHeapRealtimeThread such as the one presented above, this will bring some challenges to improve the preparation of reliable Java application threshold. There is another alternative, apply to many to be tolerated very short suspension RT applications, RT is the use of a garbage collector, for example, WebSphere Real Time in Metronome.
Metronome use applications running Lunar Lander lunar lander will lead to closer to the correct location of the place, and a high degree of measurement will not have any significant peak to ensure that each landed safely (see Figure 3).
references), shown in Figure 4:
"real-time Java, Part 2: Comparison of compiler technology" to better understand the JIT compiler for the implementation of optimization technology, JIT and AOT their respective advantages and disadvantages, as well as the two contrast.
reference, access online InfoCenter links). It will guide you to a discussion on the Lunar Lander generate runtime configuration file, how will you use this document to selectively pre-compiled Lunar Lander application and system JAR file. In addition, if you would like to try another pre-compiled applications, can also use the next section to discuss the Sweet Factory applications.
![]()
![]()
![]()
single rule). Management of shared scope is not simple, because a scope only when all the threads left when it can be recycled. That is to say, the size must be reasonable scope settings to allow multiple threads at the same time carry out its mandate.
æ€»ä¹‹ï¼Œå¦‚æžœæ‚¨åšæŒä¸€æ¬¡å¯¹ä¸€ä¸ªçº¿ç¨‹ä¸Šçš„一个任务使用一个作用域,使用NHRT 进行开å‘就比较简å•。例如,æ¯ä¸ªç”Ÿäº§çº¿è½®è¯¢çº¿ç¨‹éƒ½å°†åœ¨ä¸æœ½å†…å˜ä¸å¯åŠ¨ï¼ŒæŸ¥è¯¢ProductionLine之å‰ï¼Œè¦ä¸ºå…¶é¢„先创建一个作用域。æ¯ä¸ªç›é€‰æ± çº¿ç¨‹éƒ½å°†åœ¨ä¸æœ½å†…å˜ä¸å¯åŠ¨ï¼Œå¹¶ä½¿ç”¨æ ˆä¸Šçš„åŽŸå§‹æ•°æ®è¿›è¡Œè®¡ç®—。æ¯ä¸ªçº¿ç¨‹éƒ½å°†æœ‰ä¸€ä¸ªä½œç”¨åŸŸå¯è¿›å…¥ï¼Œå¦‚果它需è¦ä½¿ç”¨WorkerConsole接å£ï¼ˆå¯¹è±¡å°†åœ¨å…¶ä¸åˆ›å»ºï¼‰ã€‚
实时Java,第3 部分: çº¿ç¨‹åŒ–å’ŒåŒæ¥ â€ã€‚
RTSJ æä¾›äº†ä¸€ç§åœ¨NHRT å’ŒåŸºäºŽå †çš„çº¿ç¨‹é—´å…±äº«æ•°æ®çš„解决方案,那就是WaitFreeQueueç±»ã€‚è¿™äº›ç±»æ˜¯å…·æœ‰æ— ç‰å¾…端的队列,在这里,一个NHRT å¯ä»¥è¯·æ±‚读或写æŸäº›æ•°æ®ï¼ˆå…·ä½“å–决于类),而ä¸å˜åœ¨é˜»å¡žçš„风险。队列的å¦ä¸€ç«¯ä½¿ç”¨ä¼ 统的Java åŒæ¥ï¼Œç”±å †çº¿ç¨‹ä½¿ç”¨ã€‚通过é¿å…éžå †å’ŒåŸºäºŽå †çš„环境ä¸çš„é”,我们就å¯ä»¥å®‰å…¨åœ°äº¤æ¢æ•°æ®äº†ã€‚
我们的MeasurementManager将由NHRT 用于获å–度é‡ç»“æžœï¼Œç”±åŸºäºŽå †çš„å®¡è®¡çº¿ç¨‹ç”¨äºŽè¿”å›žåº¦é‡ç»“æžœã€‚å› æ¤ï¼Œæˆ‘们使用一个WaitFreeReadQueueæ¥ç®¡ç†æ¤ç»“构。 WaitFreeQueueçš„æ— ç‰å¾…端专门设计æˆå•线程。 WaitFreeReadQueue则为多个写入方ã€å•ä¸€è¯»å–æ–¹çš„应用程åºè€Œè®¾è®¡ã€‚æˆ‘ä»¬ä½¿ç”¨çš„æ˜¯å¤šä¸ªè¯»å–æ–¹ã€å•一写入方的应用程åºï¼Œå› æ¤å¿…é¡»æ·»åŠ è‡ªå·±çš„åŒæ¥ï¼Œæ¥ç¡®ä¿åŒä¸€æ—¶é—´åªæœ‰ä¸€ä¸ªNHRT 请求一个度é‡ç»“æžœã€‚è¿™çœ‹ä¼¼å› æ·»åŠ é¢å¤–çš„åŒæ¥è€Œè¿èƒŒäº†ä½¿ç”¨WaitFreeQueue的目的。但监控器控制read()方法的访问将仅在NHRT é—´å…±äº«ï¼Œå› è€Œä¸ä¼šå˜åœ¨å †å’Œéžå †ä¸Šä¸‹æ–‡ä¸çš„å±é™©é”共享。
这就带æ¥äº†NHRT 应用程åºå¼€å‘ä¸çš„åˆä¸€å¤§æŒ‘战,为在éžå †çŽ¯å¢ƒä¸ä½¿ç”¨è€Œé‡ç”¨çŽ°æœ‰éƒ¨åˆ†Java 代ç å˜å¾—æ— æ¯”è‰°éš¾ã€‚å¦‚æ‚¨æ‰€è§ï¼Œæ‚¨è¢«è¿«è°¨æ…Žè€ƒè™‘ä»Žä½•å¤„åˆ†é…æ¯ä¸ªå¯¹è±¡ä»¥åŠå¦‚何é¿å…å†…å˜æ³„æ¼ã€‚总体上æ¥è¯´ï¼ŒJava è¯è¨€å’Œé¢å‘对象编程的一大优势—— 实现细节的å°è£…—— 在éžå †çŽ¯å¢ƒä¸å˜æˆäº†ä¸€å¤§è–„å¼±çŽ¯èŠ‚ï¼Œå› ä¸ºæ‚¨ä¸å†èƒ½å¤Ÿé¢„测和管ç†å†…å˜ä½¿ç”¨æƒ…况。
至æ¤ï¼Œæˆ‘们已ç»è®¾è®¡å¥½äº†å†…å˜æ¨¡åž‹ï¼Œå›¾8 展示了更新åŽçš„ç³»ç»Ÿå›¾ï¼Œå…¶ä¸æ ‡å‡ºäº†å˜å‚¨åŒºï¼š
实时Java,第3 部分: çº¿ç¨‹åŒ–å’ŒåŒæ¥ â€ æŽ¢è®¨äº†çº¿ç¨‹ä¼˜å…ˆçº§çš„è¯¦ç»†å†…å®¹ã€‚å¯¹äºŽæˆ‘ä»¬çš„ç¤ºä¾‹ç³»ç»Ÿï¼Œè®¾ç½®ä¼˜å…ˆçº§çš„ç›®æ ‡å¦‚ä¸‹ï¼š
- 给予轮询线程最大优先级,从而最å°åŒ–丢失度é‡ç»“果的风险。
- é¿å…ç›é€‰æ± çº¿ç¨‹è¢«åžƒåœ¾æ”¶é›†å™¨ä¸æ–。
为æ¤ï¼Œæˆ‘们将轮询线程的线程优先级设置为38(最高的RT 优先级),将ç›é€‰æ± 线程的优先级设置为37。由于审计线程是一个常规Java SE çº¿ç¨‹ï¼Œä½¿ç”¨æ ‡å‡†ä¼˜å…ˆçº§5ï¼Œå› æ¤å…¶ä¼˜å…ˆçº§è¿œè¿œä½ŽäºŽNHRT。
è¿™ç§é…ç½®æ„味这垃圾收集器线程的优先级略高于审计线程—— 远低于NHRT。
下载æºä»£ç )。我们建议您阅读æºä»£ç ,看看我们所讨论的ç†è®ºå¦‚何实现为å¯è¿è¡Œçš„代ç 。
éšåŒç›‘控系的实现一起,我们还æä¾›äº†ä¸€ä¸ªè™šæ‹Ÿçš„生产线和工人控制å°ï¼Œä»¥ä¾›æµ‹è¯•监控系统。ç½åæŒ‰æ£æ€åˆ†å¸ƒè£…ç½ï¼Œå¶å°”ä¼šå‡ºçŽ°è£…å¾—è¿‡å¤šæˆ–è€…ä¸æ»¡çš„ç½å。
演示程åºä½œä¸ºä¸€ä¸ªæŽ§åˆ¶å°åº”用程åºè¿è¡Œï¼Œæä¾›è¡¨æ˜Žç³»ç»ŸçŠ¶å†µçš„æ¶ˆæ¯ã€‚
HTTP ![]()
å…³äºŽä¸‹è½½æ–¹æ³•çš„ä¿¡æ¯ ![]()
original English text.
获得产å“和技术
- WebSphere Real Time :WebSphere Real Time 使应用程åºä¾æ‰˜äºŽç²¾ç¡®çš„å“åº”æ—¶é—´ï¼Œåˆ©ç”¨æ ‡å‡†Java 技术,而未牺牲确定性。
- 实时Java 技术 :访问IBM alphaWorks 上的实时Java 技术æœç´¢ç«™ç‚¹ï¼ŒæŸ¥æ‰¾TuningFork å’ŒRT Java 的其他先进技术。
Discuss
- 通过å‚与developerWorks blogåŠ å…¥developerWorks 社区 。

åœ¨åŠ å…¥IBM Hursley Laboratory çš„Java Technology Centre System Test 团队之å‰ï¼ŒCaroline Gough 曾在一家å°è½¯ä»¶ä½œåŠåšäº†ä¸‰å¹´çš„å¼€å‘人员。她现在是高级测试师,擅长压力测试和RAS(å¯é 性ã€å¯ç”¨æ€§å’Œå¯æœåŠ¡æ€§ï¼‰å·¥å…·ä½¿ç”¨ã€‚å¥¹å‚与了IBM WebSphere Real Time V1.0 的工作,现æ£å‡†å¤‡æµ‹è¯•Java å¹³å°çš„æœªæ¥å‘布版。

Andrew Hall 于2004 å¹´åŠ å…¥IBM çš„Java Technology Centre,在æ¤ä¹‹å‰ï¼Œä»–在Southampton 大å¦å¦ä¹ 电åå¦ä¸Žäººå·¥æ™ºèƒ½ã€‚ Andrew 在Java System Test å°ç»„工作了两年,主è¦å…³æ³¨æµ‹è¯•自动化和负载测试Java è¿è¡Œæ—¶â€”— 包括WebSphere Real Time V1.0,如今是Java 5.0 Service Team çš„ä¸€åæˆå‘˜ã€‚åœ¨ä¸šä½™æ—¶é—´ï¼Œä»–å–œæ¬¢è¯»ä¹¦ã€æ‘„å½±å’Œé”æœ¯ã€‚

Helen Masters 1995 年毕业于Nottingham 大å¦ï¼Œ1996 å¹´åŠ å…¥IBM Global Services 组织,å‚与了一个大型国防项目的软件开å‘。她于2000 年调入IBM çš„Hursley Laboratory,在那里å‡å€Ÿå…¶ä¸“业技术担任了多个领导角色。 Helen ç›®å‰è´Ÿè´£é¢†å¯¼è¿›è¡ŒIBM WebSphere Real Time V1.0 测试工作的团队。

Alan Stevens 于1988 å¹´åŠ å…¥IBM Hursley Laboratory。他擅长改进IBM 产å“(如CICS å’ŒWebSphere)以åŠIBM Java 技术的性能ã€å¯ä¼¸ç¼©æ€§å’Œç¡®å®šæ€§ã€‚他在Java 工具和在JSR 163 上表示IBM(JVMTI å®šä¹‰ï¼‰æ–¹é¢æœ‰ç€å¹¿æ³›çš„ç»éªŒã€‚ä»–ç›®å‰åœ¨é¢†å¯¼IBM WebSphere Real Time Java performance å°ç»„。
Tags: Time






