Where the Software Met the Road
It's day two of JavaOne '06, and Iâ€™m over at the Slot Car Racing Programming Challenge area, where the track is heating up. Developers are standing in line, some for the 20th or 30th time! to see if their latest tweaks will pan out as they hoped. A lot has been happening here. The ABC Morning News guys were here with their cameras. Developers are taken with the chance of being onstage with James Gosling and spending some time with him. Gosling himself has been trying out the slot cars off and on for a few days. Some contestants admit that the slot car race brings them back to their childhood. Developer arenâ€™t exactly closet game junkies.
I approach one, who asked to be referred to as â€œTurtle,â€ and ask him if this is harder than he expected.
â€œItâ€™s very difficult,â€ says Turtle. (Yes, the name gives away something about his times.) â€œI have no experience with real-time. There is a lot of tuning, a lot of unknown variables â€“ every car runs a little different. So even if you tweak it right for one car, it may not work for the next. This is about my 15th attempt and Iâ€™ve missed two sessions already.â€ (Iâ€™m beginning to understand why he doesnâ€™t want his real name used.) â€œIâ€™m getting better each time, and finally made it into turn three.â€
When I ask him how this is affecting him he says he wants to build a race track in his home. â€œThis is a lot of fun. Once your car runs, the times are posted for your machine and you can figure out how fast your car is going at each sensor point. You could copy and paste this if you wanted, but it would be preferable if they gave you all of your races together so you could analyze all of the numbers.â€
Turtle informs me that the man standing next to him is tied for the lead. His name is Peter Whitfield.
â€œIâ€™m probably the worst Java programmer here â€“ Iâ€™m more of a manager than a programmer,â€ admits Whitfield. â€œIt will be embarrassing if anyone looks at my code. I have no experience with real-time Java, though 20 years ago, I worked with real-time systems. This is a lot of fun and a good opportunity to see how the real-time Java stuff works. Itâ€™s easy.â€ Different strokes for different folks.
Peter -- who is quite generous with his time as he keeps eyeing the monitor above the track listing the names of who's in the lead along with who is currently racing -- completed the race in 25.49 seconds somewhere around his 20th trial and estimates that maybe 10 or 12 people out of 100 have made it to the finish line without crashing. Clearly the hardest thing is just making it around the track. I ask him the secret to his success.
â€œKeep it simple -- do the absolute minimum necessary to get the result,â€ Whitfield explains. â€œThere are guys doing some very sophisticated algorithms but I have not actually modified the sample algorithm at all, Iâ€™ve just been changing the parameters. Nothing in this application has been hard. I have an engineering background rather than a pure software development background and this is about manipulating voltages to control the speed, and thatâ€™s second nature to me. So my background helps. I have only now started changing the way the real-time stuff works. Until now, Iâ€™ve only changed the parameters of the way the speed changes as it goes around the track, so a lot if it involves trying to figure out how, if I change the voltage in one place, it affects the speed in another. Thatâ€™s what people are missing -- they donâ€™t understand how if they go too fast in one part of the track, it will make the car unstable later. The Java side of it is very easy to pick up because we are given a sample program. We have not had to set up the framework for it. Real-time programming is about understanding physical systems; it's not as abstract as writing UI software. So you need to understand the physics of what you are trying to do and the timing.â€
I ask if he spends a lot of time visually contemplating the track. â€œAbsolutely â€“ I stare at the track trying to understand where things happen. Itâ€™s a spatial thing and physical thing. I can run the same program 10 times and get different results each time. There are 5 different cars that all perform differently. We donâ€™t know which car they will run, so we canâ€™t tune it for a specific car. The challenge is to write software that is in tune with the reality of what you are trying to make happen.â€
Peter went on to say: â€œI learned that I donâ€™t program in Java often enough, so I hope people arenâ€™t looking over my shoulder when I look up Google to figure out how I do multi-dimensional arrays. You need to be aware of where you are putting your thread to sleep and where it will wake up and if you are doing it in more than one place you need to think of the different permutations and where it can all happen.â€
And what else is Peter doing at JavaOne?.. â€œIâ€™ve spent way too much time here. I donâ€™t have a boss so I can sit here and just have fun.â€
I talk to a few other contestants waiting their turn. Jonathan Oâ€™Keefe, who does database programming, is trying out real-time for the first time. And there is Ulrich from Denmark who does web applications and GUI stuff and business logic, and Michael from Germany who does desktop programming and Carl, an American, from a company called Triego Network Security, who manages security information. None have experience with real-time. The line ebbs and flows at various times, but there's always someone racing, and there are a lot folks sitting in front of the machines set up for them on which they work on their real-time programs.
Only Carl admits to big ambitions. â€œAt first,â€ says Carl, â€œI was over-complicating it by treating it like a J2ME product, but if you are very conservative about the objects you allocate, you can treat it as a regular Java program. You have to keep it simple and not allocate anything in the loop or you will run out of memory. Iâ€™m going to try to knock someone off the leader board -- Iâ€™ve just started with the base program so there is a lot of room for improvement.â€
Carl sees uses for real-time Java at his company, Triego. â€œWe do some close to real-time work and try hard to keep our GC under control and use a concurrent generational collector, so the real-time Java technology is very interesting. We could find a lot of use for this technology in the work we do. Itâ€™s interesting and the applicability of the predictability of execution time is great.â€
As I walk away, I see that Robert Chu is tied with Peter Whitfieldâ€™s 25.49 seconds time while Richard Yee is third, at 26.18, and Rivera (I don't catch his first name) is fourth at 28.60. I wonder if any of these folks will be in the top three when James Gosling gives his keynote on Friday morning. Time and times will tell.
Stay tuned. The winners will be announced and compete one final time at the Gosling keynote on Friday. Should be a lotta fun!
Finally, here's a story about the Slot Car Racing Programming Challenge yours truly wrote over on java.sun.com:
The 2006 JavaOne Conference Slot Car Racing Programming Challenge
And, in the form of shameless self-promotion, here's an interview that I did not far back with Sun Distinguished Engineer, Greg Bollella, on real-time Java:
Programming in Real-Time Specification for Java (RTSJ): A Conversation with Distinguished Engineer Greg Bollella