Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The state of programming and compiling for multicore systems

Tags:

multicore

I'm doing some research on multicore processors; specifically I'm looking at writing code for multicore processors and also compiling code for multicore processors.

I'm curious about the major problems in this field that would currently prevent a widespread adoption of programming techniques and practices to fully leverage the power of multicore architectures.

I am aware of the following efforts (some of these don't seem directly related to multicore architectures, but seem to have more to do with parallel-programming models, multi-threading, and concurrency):

  • Erlang (I know that Erlang includes constructs to facilitate concurrency, but I am not sure how exactly it is being leveraged for multicore architectures)
  • OpenMP (seems mostly related to multiprocessing and leveraging the power of clusters)
  • Unified Parallel C
  • Cilk
  • Intel Threading Blocks (this seems to be directly related to multicore systems; makes sense as it comes from Intel. In addition to defining certain programming-constructs, it also seems have features that tell the compiler to optimize the code for multicore architectures)

In general, from what little experience I have with multithreaded programming, I know that programming with concurrency and parallelism in mind is definitely a difficult concept. I am also aware that multithreaded programming and multicore programming are two different things. in multithreaded programming you are ensuring that the CPU does not remain idle (on a single-CPU system. As James pointed out the OS can schedule different threads to run on different cores -- but I'm more interested in describing the parallel operations from the language itself, or via the compiler). As far as I know you cannot truly do parallel operations. In multicore systems, you should be able to perform truly-parallel operations.

So it seems to me that currently the problems facing multicore programming are:

  • Multicore programming is a difficult concept that requires significant skill
  • There are no native constructs in today's programming languages that provide a good abstraction to program for a multicore environment
  • Other than Intel's TBB library I haven't found efforts in other programming-languages to leverage the power of multicore architectures for compilation (for example, I don't know if the Java or C# compiler optimizes the bytecode for multicore systems or even if the JIT compiler does that)

I'm interested in knowing what other problems there might be, and if there are any solutions in the works to address these problems. Links to research papers (and things of that nature) would be helpful. Thanks!

EDIT

If I had to condense my question down to one sentence, it would be this: What are the problems that face multicore programming today and what research is going on in the field to solve these problems?

UPDATE

It also seems to me that there are three levels where multicore needs to be concerned:

  1. Language level: Constructs/concepts/frameworks that abstract parallelization and concurrency and make it easy for programmers to express the same
  2. Compiler level: If the compiler is aware of what architecture it is compiling for, it can optimize the compiled code for that architecture.
  3. OS level: The OS optimizes the running process and perhaps schedules different threads/processes to run on different cores.

I've searched on ACM and IEEE and have found a few papers. Most of them talk about how difficult it is to think concurrently and also how current languages don't have a proper way to express concurrency. Some have gone so far as to claim that the current model of concurrency that we have (threads) is not a good way to handle concurrency (even on multiple cores). I'm interested in hearing other views.

like image 700
Vivin Paliath Avatar asked Sep 05 '10 19:09

Vivin Paliath


1 Answers

I'm curious about the major problems in this field that would currently prevent a widespread adoption of programming techniques and practices to fully leverage the power of multicore architectures.

Inertia. (BTW: that's pretty much the answer to all "what does prevent the widespread adoption" questions, whether that be models of parallel programming, garbage collection, type safety or fuel-efficient automobiles.)

We have known since the 1960s that the threads+locks model is fundamentally broken. By ~1980, we had about a dozen better models. And yet, the vast majority of languages that are in use today (including languages that were newly created from scratch long after 1980), offer only threads+locks.

like image 72
Jörg W Mittag Avatar answered Oct 14 '22 00:10

Jörg W Mittag