Thursday, June 18, 2009

SSH Master

I just discovered (via blog) an amazing setting for OpenSSH: the MasterController. You can now designate an SSH invocation to run a "master" session. Then if I run SSH again connecting to the same computer, a new connection will be opened over that master session, without making a new TCP connection, establishing a new session key, or reauthenticating. This greatly speeds up connection speeds, making things like distcc a lot more practical.

I've know this was possible from using the commercial SSH for Windows on school computers, I just had no clue how to get it working from the Unix world until now.

Wednesday, June 17, 2009

Chrome parallelism

If you haven't used Google's new Chrome browser, it's definitely worth looking at. The team at Google has written a browser that tries to address some of the shortcomings of other modern browsers. Each part of a web page, the renderer, the JavaScript engine, plugins, etc. all operate in their own processes. This lets each component be isolated from one another in separate address spaces. So when Flash crashes, or Acrobat gets exploited, other tabs keep on going. (I believe the latest Internet Explorer also does something similar to this.) Having separate processes also helps reduce memory fragmentation.

Compare this with the dominant method for writing parallel programs: shared memory with locks and condition variables. That system is fast, but plagued with problems. Shared memory doesn't enforce exclusive access: the programmer is responsible for getting the right locks. When she doesn't, data races happen. If she gets the ordering of some locks wrong, deadlocks could happen. If locks are too fine-grained, she might introduce atomicity violations. And if one thread fails, what can you do if it's holding locks and has left shared state inconsistent?

A simpler life exists: do not share memory, and use explicit communication between concurrent processes. Instantly, locking goes away. No deadlocks, no data races. Failure handling becomes simpler, since no state can be corrupted.

This kind of model is used in the Erlang language, and microkernels have featured these benefits for years. Erlang was developed to be exceptionally fault-tolerant, and still drives critial hardware systems (in addition to Facebook's IM application). These systems haven't been used extensively in part because shared memory is fast. (And perhaps because of Erlang's syntax.) As a result, we researchers try to replay data races quickly and design fault-tolerant wrappers for Linux kernel modules.

I'm glad to see a significant desktop application decide that fault-tolerance and isolation is more important than raw speed.

Tuesday, June 16, 2009

Restaurant deals and BBQ

This week in Ann Arbor, restaurants all along main street will be wooing townies to sample their meals by offering fixed-price menus. Waltz in and be treated to a selection of the restaurant's finest three-course meal for only $25. It's all part of Ann Arbor Restaurant Week.

My wife and I were looking through the menus online when we began to ask ourselves, "Just how much are we saving by eating out for this special event?" After searching through a couple of menus, it turns out to be wrong for us. Restaurants aren't offering special menu items, so we just priced the same meal. Some places offered choices, so we chose the most expensive items to compare.

We found that most places only save us a couple of dollars off the equivalent meal. In one case, the fixed price dinner (with no options) would cost $1 more than normal. But it's worse than that. When we go out, we would order less food than 2 fixed meals: we typically split appetizers and deserts. Taking that into account, there wasn't a single restaurant we looked at that presented us a true savings.

So what is the use of Restaurant Week? It's all just advertising, pure and simple.

Usually, I hate letting myself be influenced by advertising, but this time, the advertisers were successful. Not in the way they intended though.

We had been trying to pick out our favorite place for BBQ baby-back ribs in Ann Arbor, and we thought this would be a good time to experiment. We headed home with a half-rack of ribs from our two top-runners: Grizzly Peak and The Blue Tractor. They're owned by the same parent company, but they do serve different food. We'd been going back an forth on this issue for a while now, so we finally made the direct comparison.

The winner: Blue Tractor sauce on Grizzly Peak meat. Grizzly Peak's meat was more tender and better quality, but the sauce was really too sweet. Blue Tractor had a nice spicy sauce, but its meat was a little tough. Since meat quality could vary by the night and by chef, we can't definitively say which place serves better ribs, but our bet's on Blue Tractor.