Skip to main content

Where the Software Met the Road

Posted by hiheiss on May 19, 2006 at 3:53 PM PDT

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
http://java.sun.com/javaone/sf/slot_car.jsp

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
http://java.sun.com/developer/technicalArticles/Interviews/Bollella_qa2.html