views:

1875

answers:

12

If you want to create programs with threads/processes that run parallel you have to learn about many stuff, like race conditions, locks, semaphors, monitors, deadlocks ....

Is there a language that makes creation of parallel programs as easy as object-oriented programming languages help creating complex architectures? Or which programming-languages has the best and simplest concepts to support you with this task?

+2  A: 

None. Concurrent programming is never easy. :(

Dima
it says easy as possible not easy period
Mark Cidade
No sense of humor, I see...
Dima
It's an amusing comment, and while it may not answer the question directly, it may still be a valid point.
Adam Batkin
+25  A: 
Martin Beckett
I think that the image didn't show because you had a space between the brackets and parentheses. The previewer's parsing is slightly more forgiving.
Mark Cidade
I LOVE ERLANG!!
ryeguy
A: 

I haven't used it yet, but I have read a lot about Erlang doing concurrency REALLY well... basically there are no threads, only processes. On top of that, you can only send read only messages.

From what I've heard, they have done concurrency in a way that is very easy to deal with, and scales well... but again, I haven't done it myself, but it is something you may want to look into :-)

Mike Stone
+2  A: 

Erlang was designed precisely for such things. Ericcson (the electronics company) invented it so they could make their mission-critical applications fault tolerant and clusterable.

Just Some Guy
A: 

My uneducated guess is that using a 'Shared Nothing' strategy/pattern/principle is the best way to write a concurrent program.

It should be possible to have 'Shared Nothing' in any language.

quamrana
+2  A: 

Erlang was built with concurrency in mind. It's a functional programming language that is supposed to scale very well. If you're looking for a more object-oriented language, I've found the easiest OO language to do concurrency in is Java. Even then it is still quite difficult (and it will be useful to learn all those additional principles of concurrent execution). The java.util.concurrent package added in Java 1.5 did add a great deal of additional functionality.

+3  A: 

Occam

Steven A. Lowe
+7  A: 

Summary for the impatient: Know the principles behind functional programming. The rest comes relatively easy regardless of your choice of language.

In principle, you can even use C/C++ for concurrent programming as easily as functional languages, if you follow the conventions of the functional programming . For example, if you pass an object to a function and return a new object without modifying the original, you both avoid side effects, minimize memory management headaches and don't sacrifice flexibility for the inevitable hacks. This style also gives modern compilers plenty of opportunities to optimize object passing.

The point is, if you know how to apply these principles, the choice of language becomes less important.

artificialidiot
+3  A: 

Clojure

Alex Miller
+1  A: 

I'd say Qt4's QtConcurrent APIs makes it relatively easy to do that.

OneOfOne
+2  A: 

As verticalarhat pointed out,

Java 1.5 and Java 1.6 have made concurrent programming a lot more accessible to developers. Java 1.5 introduced some concurrent collections and "Future Task" constructs. Java 1.6 has really improved and elaborated on all this, with Concurrent Queues, Thread Pools, Task Executors. Open-source frameworks such as http://ehcache.sf.net/ and springframework have evolved to fully-leverage them, one of my current favorites being org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.

I've pushed to production a number of highly-loaded applications that use the living daylights out of those constructs, and it's a real joy to see all 8 of your CPU Cores equally-pegged as your app hums along.

Concurrent collections, queues and thread pools are a big deal. Until those were readily available and easy-to-use, many application-scaling patterns were only available if you spent a lot of money on high-priced frameworks from the likes of Oracle.

Chris Holland