O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Real-Time Java™ Platform Programming

Book Description

Build powerful real-time Java platform applications.

  • The authoritative reference to the Real-Time Specification for Java (RTSJ)—by one of its creators

  • Complete introduction to Java-based RT development—no real-time experience necessary

  • Covers scheduling, asynchronous transfer control, timers, non-heap memory, garbage collection, performance tradeoffs, program structure, and more

  • Written for experienced Java platform developers, this practical guide provides a solid grounding in real-time programming. Dibble, a member of the RTSJ expert group, starts with an overview of real-time issues unique to the Java platform. He then explains how to use each major feature of the RTSJ.

    From broad real-time principles to detailed programming pitfalls, Real-Time Java Platform Programming covers everything you need to know to build effective RT programs. Key topics include:

  • Interoperability with non-RT code, tradeoffs in real-time development, and RT issues for the JVMtm software

  • Garbage collection, non-heap access, physical and "immortal" memory, and constant-time allocation of non-heap memory

  • Priority scheduling, deadline scheduling, and rate monotonic analysis

  • Closures, asynchronous transfer of control, asynchronous events, and timers

  • State-of-the-art information for RT developers:

  • Threads scheduling

  • Real-time scheduling

  • Raw memory access

  • Performance tradeoffs

  • Recommended practices

  • Implementation hints

  • Dozens of code examples and step-by-step walk-throughs

  • Table of Contents

    1. Copyright
    2. Preface
    3. Introduction
    4. Landscape
      1. Java Technology and Real Time
      2. Definition of Real Time
      3. Java's Problem Domain
      4. Real-Time Java's Problem Domain
      5. Summary
    5. Architecture of the Java Virtual Machine
      1. Write Once, Run Anywhere—Maybe
      2. JVM Components
      3. Interpreter Implementation
    6. Hardware Architecture
      1. Worst-Case Execution of One Instruction
      2. Management of Troublesome Hardware
      3. Effects on the JVM
    7. Garbage Collection
      1. Reference Counting
      2. Basic Garbage Collection
      3. Copying Collectors
      4. Incremental Collection
      5. Generational Garbage Collection
      6. Real-Time Issues
    8. Priority Scheduling
      1. Scheduling Terms
      2. Execution Sequences
      3. Preemption
      4. Fixed versus Dynamic Priority
      5. Priority Inversion
      6. Why 32 Priorities?
      7. Problems with Priority Scheduling
    9. Scheduling with Deadlines
      1. Underlying Mechanism
      2. Scope of the Scheduler
      3. Some Systems
      4. Timing Is Usually Probabilistic
    10. Rate Monotonic Analysis
      1. Theorems
      2. Restrictions
    11. Introduction to the Real-Time Java Platform
      1. A Brief History of Real-Time Java
      2. Major Features of the Specification
      3. Implementation
      4. RTSJ Hello World
    12. Closures
      1. The Language Construct
      2. Java Closures
      3. Limitations of Closures
    13. High-Resolution Time
      1. Resolution
      2. The “Clock”
      3. HighResolutionTime Base Class
      4. Absolute Time
      5. Relative Time
      6. Rational Time
    14. Async Events
      1. Binding a Happening to an Event
      2. Basic Async Event Operation
      3. Async Events without Happenings
      4. Implementation Discussion
    15. Real-Time Threads
      1. Creation
      2. Scheduling
      3. Periodic Threads without Handlers
      4. Periodic Threads with Handlers
      5. Interactions with Normal Threads
      6. Changing the Scheduler
    16. Non-Heap Memory
      1. The Advantage of Non-Heap Memory
      2. The Allocation Regimes
      3. Rules
      4. Mechanisms for Allocating Immortal Memory
      5. Mechanisms for Allocating from Scoped Memory
      6. Using Nested Scoped Memory
      7. Using Shared Scoped Memory
      8. Fine Print
      9. Quick Examples
    17. Non-Heap Access
      1. Interaction with Scheduler
      2. Rules
      3. Samples
      4. Final Remarks
    18. More Async Events
      1. Async Events and the Scheduler
      2. The createReleaseParameters Method
      3. Bound Async Event Handlers
      4. Async Event Handlers and Non-Heap Memory
      5. No-Heap Event Handlers vs. No-Heap Threads
      6. Scheduling
      7. Async Event Handlers and Threads
      8. Special Async Events
    19. Reusing Immortal Memory
      1. Using Fixed-Object Allocators
      2. Recycling RT Threads
      3. Recycling Async Event Handlers
    20. Asynchronous Transfer of Control
      1. Thread Interrupt in Context
      2. Asynchronous Interrupt Firing
      3. Rules for Async Exception Propagation
      4. Noninterruptible Code
      5. Legacy Code
      6. Use of ATC for Thread Termination
    21. Physical Memory
      1. Physical and Virtual Memory
      2. Physical Memory Manager
      3. Immortal Physical Memory
      4. Scoped Physical Memory
    22. Raw Memory Access
      1. Security
      2. Peek and Poke
      3. Get/Set Methods
      4. Mapping
      5. The RawMemoryFloatAccess Class
    23. Synchronization without Locking
      1. Principles of Wait-Free Queues
      2. The Wait-Free Write Queue
      3. The Wait-Free Read Queue
      4. The Wait-Free Double-Ended Queue
      5. No-Wait Queues and Memory
      6. Implementation Notes
    24. Recommended Practices
      1. Powerful and Easy-to-Use Features of the RTSJ
      2. Very Powerful and Dangerous Features of the RTSJ
      3. Very Powerful and Finicky Features of the RTSJ
      4. Selection of Priorities
    25. Index