Click here to monitor SSC

Tony Davis

Simple-Talk Editor
News, views and good brews

Multi-core Mania

Published Tuesday, March 31, 2009 5:02 PM

When the market is slack, nothing succeeds better at tightening it up than promoting serial group-panic within the community. As an example of this, a wave of multi-core panic spread across the Internet about 18 months ago. IT organizations, it was said, urgently had to improve application performance by an order of magnitude in order to cope with rising demand. We wouldn't be able to meet that need because we were at the "end of the road" with regard to step changes in processor power and clock speed. Multi-core technology was the only sure route to improving the speed of applications but, unfortunately, our current "serial" programming techniques, and the limited multithreading capabilities of our programming languages and programmers, left us ill-equipped to exploit it. Multi-core mania gripped the industry.

However, the fever was surprisingly short-lived. Intel's "largest open-source effort ever" to provide a standard tool for writing multi-threaded code, caused little more than a ripple of interest. Various books, rushed out while the temperature soared, advocated the urgent need for new "multi-core-friendly" programming models, involving such things as "software pipelines". Interesting as they undoubtedly are, they sit stolidly on bookshelves, unread.

The truth is that it's simply not a big issue for the majority of people. Writing truly "concurrent" applications in languages such as C# is difficult, as you get very little help from the language. It means getting involved with low-level concurrency primitives, such as lock statements and so on.

Many programmers lack the skills to do this, but more pertinently lack the need. Increasingly, programmers work in a web environment. As long as these web applications are deployed to a load-balanced web farm, then page requests can be handled in parallel so all available cores will be used efficiently without the need for the programmer to be concerned with fine-grained parallelism.

Furthermore, the SQL Server engine behind these web applications is intrinsically "parallel", and can handle and use effectively about as many cores as you care to throw at it. SQL itself is a declarative rather than procedural language, so it is fundamentally concurrent.

A minority of programmers, for example games programmers or those who deal with "embarrassingly parallel" desktop applications such as Photoshop, do need to start working with the current tools and 'low-level' coding techniques that will allow them to exploit multi-core technology. Although currently perceived to be more of "academic" interest, concurrent languages such as Erlang, and concurrency techniques such as "software transactional memory", may yet prove to be significant.

For most programmers and for most web applications, however, the multi-core furore is a storm in a teacup; it's just not relevant. The web and database platforms already cope with concurrency requirements. We are already doing it.

As always, we'd all love to hear what you think. The best contribution to the debate, added as a comment to this blog, will receive a $50 Amazon voucher.

Cheers,

Tony.

Comments

 

BuggyFunBunny said:

>> Furthermore, the SQL Server engine behind these web applications is intrinsically "parallel", and can handle and use effectively about as many cores as you care to throw at it. SQL itself is a declarative rather than procedural language, so it is fundamentally concurrent.

I was finally persuaded to start a blog because of the multi-core cpu and solid state disk.  Nor am I the only one, to speculate that the RDBMS will have a renaissance just because relational engines have been the subject of research, experimentation, and implementation of parallel programming for decades.  Nobody knows more about how to do parallel than engine writers.  They have to be the spookiest people on the planet.  


>> For most programmers and for most web applications, however, the multi-core furore is a storm in a teacup; it's just not relevant. The web and database platforms already cope with concurrency requirements. We are already doing it.

The client machine, web or otherwise, just needs to write a screen.  That screen may be made of lots of pretty pixels, but, should AJAX and bandwidth prevail, then we'll be back to the state of grace which existed back in the late 1980's to early 1990's when *nix databases talked RS-232 to VT-220's.  Well, and SQLServer over NetWare and such, too.  In any case, a character mode interface hard wired to the datastore.  Ah bliss.  All concurrency and integrity of the data will be controlled by the server, and the client will just paint the screen; the client (both the machine and the human) can't screw up the data.

What many folks don't realize is that the Web (sans AJAX) is just a block mode disconnected interface, identical to the 3270/mainframe of 1975.  JavaScript now, 3270 edit programs then.  Such progress.
March 31, 2009 12:39 PM
 

mrwcjoughin said:

You are right and wrong about C# not supporting parellel processing.

In the current version of C# it is possible, but not easy, as you say.

But in C# 4.0, which is part of Visual Studio 2010, does.

I have seen it demosrated at a Microsoft DevDays event, and it was pretty amazing the speed difference in being able to target all the cores.

Here is a quote from a mvp blog that explains the new feature:
"
Parallel Processing
Moore's law has changed from single processors doubling in speed every 18 months to doubling in processing power through increased core count every 18 months.  This means for applications to make use of processing power increases they must increasingly make use of parallel processing and multi-threading.  The PFX makes this more a reality by providing a framework by which application designers can more easily write code to support multi-core processors and multi-processor computers.

With PFX writing a loop to make use of multiple processors (while still supporting single processors) will be as easy as:

   uint[] numbers = new uint[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
   Parallel.ForEach(numbers, delegate(uint number) { Trace.WriteLine(CalculateFibonacci(number)); });
"

This will bring parallel programming to the masses, and then perhaps we will finally start to see the cores being used, at least by all excepting the most lazy programmers
April 1, 2009 12:48 AM
 

Andrew Clarke said:

An energetic and interesting response to the Editorial here by Ted Neward...

http://blogs.tedneward.com/2009/04/01/quotMulticore+Maniaquot+A+Rebuttal.aspx

'...It's dangerously ostrichian in nature—it encourages developers to simply bury their heads in the sand and ignore the freight train that's coming their way.'
April 1, 2009 6:03 AM
 

timothyawiseman@gmail.com said:

As you allude in the article, the question is what type of software is being written.  When you are writing software that interacts with a middle layer (such as the web engine or a database) then the middle layer can handle concurrency issues for you for the most part and they are irrelevant.

On the other hand, if you are writing software that runs directly on the hardware then you need to be very concerned with concurrency.  This definitely applies to games and photoshop as you mentioned in the article, but it goes far beyond that.  Any desktop application such as financial, mathematical, media editing or any other end user application that runs on their desktop falls into this category.  This is also true of programs that have to do significant data processing wherever they may reside.

I agree that many developpers will never work on this type of software and therefore have no need to worry about it, but that still leaves a very significant number of developpers for which this will be a prime concern very quickly.
April 1, 2009 4:04 PM
 

BuggyFunBunny said:

Since Mr. Neward took it upon himself to make such a big stink about this editorial, the following article in today's Tmes (West of the Pond edition) makes it quite clear who is right:

http://www.nytimes.com/2009/04/02/technology/02netbooks.html?_r=1&ref=business

Multi-core/processor machines are *not* the future of consumer computing.  They will play a large role in database, and other, servers.  They will be the future of true workstation computing.  Who's the Ostrich?  Enquiring minds want to know.
April 2, 2009 2:23 PM
 

Andrew Clarke said:

The discussion seems to have moved across to ....
http://blogs.tedneward.com/CommentView,guid,f3062e21-fcf4-40f0-ac1f-8e212c931667.aspx#commentstart
... which is a bit of a shame.
April 3, 2009 4:27 AM
You need to sign in to comment on this blog
<March 2009>
SuMoTuWeThFrSa
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234
How to Kill a Company in One Step or Save it in Three
 The majority of companies that suffer a major data loss subsequently go out of business. Wesley David... Read more...

Migrating from OCS 2007 R2 to Lync: Part 4
 Having migrated the rest of our users and legacy resources across and started getting ready to... Read more...

Automated Script-generation with Powershell and SMO
 In the first of a series of articles on automating the process of building, modifying and copying SQL... Read more...

Seth Godin: Big in the IT Business
 Seth Godin has transformed our understanding of marketing in IT. He invented the concept of 'permission... Read more...

Using SQL Test Database Unit Testing with TeamCity Continuous Integration
 With database applications, the process of test and integration can be frustratingly slow because so... Read more...