Asynchronous event handling and Safety Critical Java

Andy Wellings, Minseong Kim

Research output: Contribution to journalArticlepeer-review

Abstract

Over the last few years, the Java Community Process (under the auspices of Java Specification Request 302) has been developing a subset of Java augmented by the Real-Time Specification for Java (RTSJ) for use in safety critical systems. The concurrency model supported by Safety Critical Java (SCJ) relies almost exclusively on an event-based model rather than on a thread-based model. This paper reviews the advantages and disadvantages of the two models and gives the pragmatic reasons that SCJ has adopted the former model. It describes the SCJ approach and gives a simple example of how it can be used, illustrating the difference in style between the RTSJ and SCJ code. The paper then considers the compatibility of the SCJ model with the RTSJ. It argues that by basing the SCJ classes on the RTSJ's BoundAsyncEvent class, some inconsistencies exist between the SCJ and the RTSJ models. Furthermore, some of the optimizations that are possible when mapping handlers to server threads are inhibited, even though the programming restrictions necessary for these optimizations are imposed by the SCJ specification. A revised model is presented that has a slightly more complicated API but is more consistent with the RTSJ and allows the optimizations. However, there is a resulting increase in the necessary run-time support, particularly for multiprocessor implementations.
Original languageEnglish
Pages (from-to)813-832
Number of pages20
JournalConcurrency and Computation: Practice and Experience
Volume24
Issue number8
DOIs
Publication statusPublished - 10 Jun 2011

Cite this