MulticoreInfo.com header image 2

How to scale to 256 processors and beyond

November 7th, 2008 · No Comments




Recently ZDNet blogger Mary-Jo Foley wrote an article, “Windows 7 to scale to 256 processors“. In response to that another ZDNet blogger Ed Burnette writes an article on how to scale to 256 processors and beyond with his programming experience.

“There are two main issues: a simple problem with describing a set of CPUs to run on, and a more complicated problem with lock contention. Let’s look at the simple one first.

CPU enumeration

Way back when Windows was first conceived, multi-core chips weren’t even a twinkle in Intel’s eye. There were some very high end machines with multiple sockets, though, and each socket could accept a chip with a single CPU core. So it wasn’t out of the question that in the future these multi-socket machines could become more common and more powerful, especially for server boxes. How many sockets can you put on a motherboard? 2? 4?

Just to be safe Microsoft allowed for 32, not because they really expected anyone to have 32 but because the word size of the brand new Pentium chips was 32 bits. In one register (or ‘int’ in C) you could keep a flag for each CPU. If your program wanted to confine itself to run on certain CPUs (this is called “affinity”) then you could make an operating system call and pass a bit mask of all of those CPUs. For example if you wanted to only run on the first, second, and fifth CPU then you could pass the hex number of 0×13, or binary 010011.”

Lock contention is the real problem and Ed explains more on that as well.

“The best solution to avoid lock contention is not to use locks at all. A lot of research has been done on lock-less data structures and “concurrent” programming. Unfortunately it’s still not well understood by mainstream developers and requires a paradigm shift in the way you think about programming. It’s not practical to introduce into a large and complex existing system.

The second-best solution, which is the route chosen by Windows 7 engineers, is to turn your big locks into smaller, more granular locks. ”

Full Story

Related Stories
Channel 9 video interview of Mark Russinovich about Windows 7 kernel futures

  • Share/Save/Bookmark

Tags: MulticoreInfo · Performance · Programming

Like what you're reading? Come back every day for multicore news, or subscribe to RSS updates.



Stumble It!