background preloader

Multithreading

Facebook Twitter

Multicore

Designpatterns. Concurrency interview with DevX. 2008-05-08 by Herb Sutter Part 2 of DevX’s interview with me about concurrency just went live on the web.

concurrency interview with DevX

From the article’s blurb: What does the future hold for concurrency? What will happen to the tools and techniques around concurrent programming? In part two of our series, concurrency guru Herb Sutter talks about these issues and what developers need to be reading to understand concurrency. … In this final installment he looks into his crystal ball with an eye towards the future and gives developers hints for the resources they need to be better concurrent programmers. This part touches on a variety of topics, from right-now items like delivering parallelism internally inside libraries to shield the programmer from knowing about concurrency and where to look for further reading, to future topics like transactional memory and upcoming homogeneous vs. heterogeneous manycore CPUs. (March’s part 1 is here.) The "C is Efficient" Language Fallacy. I came across an article yesterday about programming languages, which hit on one of my major peeves, so I can’t resist responding.

The "C is Efficient" Language Fallacy

The article is at greythumb.org, and it’s called [Programmer's rant: what should and should not be added to C/C++]( It’s a variation on the extremely common belief that C and C++ are the best languages to use when you need code to run fast. They’re not. They’re good at things that need to get very close to the hardware – not in the efficiency sense, but in the sense of needing to be able to fairly directly munge the stack, address specific hardware registers, etc. But they are *dreadful* languages for writing real scientific and/or numerical code. To quote the part of the article that set me off: >First of all, these fears are nonsense. Here’s the problem. Making real applications run really fast is something that’s done with the help of a compiler.

So for modern systems, writing an efficient program is sort of a partnership. Parallel Extensions to the .NET Framework. This article was originally published in VSJ, which is now part of Developer Fusion.

Parallel Extensions to the .NET Framework

Recently there has been a shift in the advancement of hardware. Your computer’s speed is not double what your previous computer’s speed was. Whereas before all of that extra silicon meant faster and faster processors, now it means more and more cores. Note that for the purposes of this article, multiple CPUs will be treated as the equivalent of multiple cores (and vice versa). Most developers I know are running on at least a dual-core machine. A couple of months ago, Microsoft released the December Community Technology Preview (CTP) of the Parallel Extensions to the .NET Framework v3.5 (affectionately referred to in this article as “Parallel Extensions”). Imperative Task Parallelism Don’t worry too much about the title of this section, because it’s essentially all about using the Task and TaskManager class. Thread t = new Thread(DoSomeWorkMethod); t.Start(someInputValue); Figure 1 Figure 2 Figure 4.

Memory Models: Understand the Impact of Low-Lock Techniques in Multithreaded Apps.