Multicore programming explained, by Professor David May

itemid-52590-getasset.jpgProgramming general purpose multi-core processors is generally regarded as impossible, but XMOS Semiconductor has done it and is applying it in practical applications, according to the CTO of XMOS, Professor David May FRS who is professor of Computer Science at Bristol University and the architect of the Inmos multi-core Transputer.

“Alan Turing and John von Neumann having done sequential computing, moved onto parallel computing. But for the last 50 years we’ve practised sequential computing,” May told EW, adding, “the mistake we make in programming parallel processors is  because of  history.. To try and take a sequential programme and run it on several cores is impossible.”

“But in the context of the systems we’re now building today, everything has lots of interfaces and we expect them all to run at the same time,” added May, “there are good reasons why we’ve put extensions onto C for the XMOS SDS (Software Defined Silicon) multi-core chips. All that those instructions are saying is ‘Do all these things at once’. We go to hardware programmers and show them our programming language and it doesn’t take them very long to learn it.”

Current attempts to use multi-cores in the mainstream computing world, like the efforts made by Intel and Microsoft with a bunch of US universities, may be doomed. “I think they (Intel and Microsoft) are trying to solve a different problem,” said May, “they’re taking all the PC applications and putting them on multi-cores. That’s a very different problem and, in my view, they won’t be very successful. Taking sequential programmes and trying to make them run in parallel is virtually impossible.”

May sees three approaches being followed for programming multi-cores which have no chance of success. First the shared memory approach. “Shared memory is incredibly difficult to do,” said May, “Intel have tried for years to optimise access to  memory and now they’re trying to put several cores to accessing one memory and it becomes more and more complex. If you take a general purpose processor the cores are fighting to get access to the memory system.”

Secondly people put their faith in compilers. “Some people will bet on complex heterogeneous architectures and compilers that do magical optimisations  – if they don’t know that compilers take much longer to develop than hardware.”

Thirdly: “Some people will bet on abstraction layers to allow legacy software to be ported to parallel machines – if they haven’t yet discovered why their mobile phone takes so long to boot,” said May.

For the future, computers will have to change. “The emphasis on process structures will replace emphasis on data structures”, said May, “with von Neumann, the idea is that what you scale up is the memory. People are still hanging onto that model. The emphasis should now be on how data is moved around in the memory.”

With the cost of processors down the level of what a bit cost 30 years ago, there has to be a major change in computer engineering. “A universal computer is an infinite array of finite processors, not a finite array of infinite processors,” said May.

Sequential programming has an unfortunate effect. “It opens up an artificial gap between hardware and software,” said May, “hardware is concurrent. I never see these things as fundamentally different. There is no difference between the way you make hardware, and the way you write software.”

Although youngsters have no problem with the concept of concurrent programming, it is not being taught at mainstream computing courses. “It’s seen as a specialised topic, which I see as very odd,” said May.

Even worse is: “Getting people to solve concurrent problems using sequential code which is silly.”

“Systems are naturally concurrent”, added may, “for instance robots have motors, vision and communications working all at the same time. These things all go on together. It’s the same in  life. You don’t get up in the morning and think: ‘I’m now going to do a series of things in sequence’. You put on your coffee-maker to make the coffee while you’re in the bathroom.”

Tags: multicores, XMOS

Related posts