Sunday, July 01, 2007

Twin heartbeats: watching a multi-core processor at work

Recently I started using a Lenovo (nee IBM) Z61t laptop, replacing my late lamented X40. The new computer sports a dual core Intel processor. This means it sort of has two CPUs.

It's fun to watch the two processors vie for work to do when a single-threaded task is at hand. I do a lot of work crunching search logs, and when you exceed about 32,000 rows in an Excel spreadsheet, things begin to bog down. Even gathering the data in a large Internet Explorer window can take a lot of CPU and a lot of real time. If you are running one single-threaded program, Windows reports your CPU as 50% or so until the task completes. The Windows Task Manager shows this in action. The "extra" core of the processor is available to handle other tasks, and the work appears to be divided equally between the two:

Click to see full-size image

If you're running more than one app, or if the app you're running is multi-threaded, then both halves of the CPU can do useful work. For instance, when I copy 200,000 rows of data from IE to Excel, the CPU runs at close to 100%.

My friends Chuck Severance, who literally wrote the book on high performance computing, and Bill Punch, who heads the High Performance Computing Center at Michigan State, understand all this full well. For me, an amateur observer of the end of Moore's Law and our multi-processor future, it's fun to watch.