![]() |
||||
|
| ||||
The 2006 JavaOne Conference Slot Car Racing Programming Challenge The 2006 JavaOne Conference Slot Car Racing Programming Challenge, designed by Sun Distinguished Engineer and Real-Time Specification for Java (RTSJ) (JSR-01) lead, Greg Bollella, is bringing real-time programming to attendees in a fun and exciting demo. Here's the story: Standard 1/24 scale cars run around a track with 80 sensors spread along its length and with a power supply controlled by an A/D converter driven from a workstation. The sensors are simple photocell gates similar to those that detect paper moving through a printer. Normally, the cars are driven by a small hand-held controller that competitors press to send voltage to speed up the car. Contestants are challenged to write RTSJ code that controls the car while making it go as fast as possible without flying off the track. The Real-Time Java program senses the track position of a slot car and sets the voltage to the track — and thus the speed of the car. The program detects whether or not the car is over a sensor, but it doesn't know which sensor, since all the sensors are effectively merged together. Therefore, developers who enter the Challenge have to write a polling loop that gathers the sensor data and keeps track of where the car is based on the sensor map. Then the program gives the car the appropriate voltage that speeds it up on the straight-aways and slows it down on the curves. Contestants will write the code in the labs and bring it to the track where it will be run on a workstation. The top three finishers receive prizes and will face off live during James Gosling's keynote on Friday morning. Runs are conducted on a first-come, first-served basis and contestants can have as many runs as time permits. For example, those with wireless laptops can return to the end of the line when their run is over, enter coding changes, and wait their turn. If a car crashes, the track operator will stop the program and give the car a time of 1,000 seconds, effectively removing any possibility of success. James Gosling, who has made contributions to RTSJ, observed that, "It's remarkably easy to send the car flying off the corners."
Dispelling Real-Time Java FUD In addition to being fun, the Challenge is intended to dispel Real-Time Java FUD, especially the idea that it is hard to program in RTSJ. As Bollella puts it, "The Slot Car Challenge will prove that anyone can program with RTSJ. If a developer gets the car to go around the track without missing any of the sensors, they will have written hard real-time code in the most rigorous sense of hard real-time. I want to get the message across to the developer community: Programming in Real-Time Java isn't rocket science. It's more like bicycle science." "Hard" real-time logic refers to responses to real-time events that must never fail to occur within the set period — if the logic fails with the slot cars, they crash. "Soft" real-time is suitable for systems where the consequences of missing a deadline are allowed, but allowed in a predefined, understood manner. Java technology has, for the most part, been used with non-real-time logic in the past. Considerable confusion exists about Real-Time Java, starting with the name itself. "Real-time" is often mistaken to mean "real fast," whereas in fact it means to "respond within a reliable and predictable time." It's less about speed and more about absolute reliability.
In engineering RTSJ, Bollella's group has taken a highly-engineered and optimized system platform, the HotSpot JVM, and modified it so that it not only retains its value for non-real-time programs, but can engage in real-time programming of physical systems with relative ease. RTSJ, the only real-time Java technology, is 100% Java and was started in 1998 and developed by a team of experts from several diverse communities: RT-scheduling, embedded systems design, Ada design, Java design, embedded processor design, real-time systems design, academia, RTOS design, and others. Real-time Java has proved itself in diverse ways. The military has employed it to detect inbound missiles. Telecommunications infrastructure provides excellent call handling, but occasionally a line is broken and must be addressed within a narrow time slice where RTSJ proves its mettle. In finance, where the value of a large position can change by a million dollars in a second, and stock traders describe themselves as in a technology arms race with the competition, Real-Time Java has been effective. It has also been used in industrial automation and the automotive industry. Dangling by a Thread Threading is of paramount importance to RTSJ and two new thread types have been created.
The
The
In addition to the myth that RTSJ is hard or weird other myths persist: It's a myth that most libraries don't work in a NoHeap context — most work fine. Converting to Real-Time Java Converting a 'normal' Java program to a Real-Time Java program is surprisingly easy and essentially involves a syntax change.
For starters, replace: And you get industrial-strength, real-time garbage collection, plus 28+ priorities that actually work, priority inheritance protocol, physical memory, and more. For more details check out TS-1904, "Real-Time Java Technology: Why It Matters to You and What You Should Do About It!" with Greg Bollella and Dave Hofert of Sun, plus Paul Perrone of Perrone Robotics, Ed Pla of Boeing and David Atkins of PrismTech, on Friday, May 19, from 1:15-2:15. See Also
| ||||
Comments | About
Sun | Privacy | Terms
of Use | Trademarks | Third
Party Content Disclaimer Conference content is subject to change. Copyright 1996 - 2006 Sun Microsystems, Inc. |
![]() |
|