Questions tagged [parallelism]

93 questions
129
votes
9 answers

The difference between "concurrent" and "parallel" execution?

What is the difference between the terms concurrent and parallel execution? I've never quite been able to grasp the distinction. The tag defines concurrency as a manner of running two processes simultaneously, but I thought parallelism was exactly…
Louis Thibault
  • 2,178
  • 3
  • 16
  • 17
91
votes
10 answers

How to explain why multi-threading is difficult

I am a fairly good programmer, my boss is also a fairly good programmer. Though he seems to underestimate some tasks such as multi-threading and how difficult it can be (I find it very difficult for anything more than running a few threads, waiting…
Mr Shoubs
  • 841
  • 1
  • 8
  • 12
50
votes
5 answers

What is it about functional programming that makes it inherently adapted to parallel execution?

I've been reading over and over that functional languages are ideal (or at least very often useful) for parallelism. Why is this? What core concepts and paradigms are typically employed and which specific problems do they solve? On an abstract…
39
votes
11 answers

Concurrency: How do you approach the design and debug the implementation?

I've been developing concurrent systems for several years now, and I have a pretty good grasp on the subject despite my lack of formal training (i.e. no degree). There's a few new languages that have become popular to at least talk about lately…
Berin Loritsch
  • 45,784
  • 7
  • 87
  • 160
26
votes
4 answers

Do compilers optimise in concurrency?

Presuming that I have written some sequential code where it can be broken down into multiple isolated tasks, it seems it might be efficient for concurrency to be introduced. For example print(expensive_calc_one() + expensive_calc_two()) Asuming…
Ben
  • 369
  • 3
  • 5
25
votes
5 answers

Is objected oriented programming paradigm outdated since it is anti-modular and anti-parallel?

I have read the controversial article Teaching FP to freshmen posted by Robert Harper who is a professor in CMU. He claimed that CMU would no longer teach object oriented programming in the introductory course sine it is “unsuitable for a modern CS…
19
votes
1 answer

Using uniqueness types to implement safe parallelism

I've been interested in uniqueness types as an alternative to monads in pure functional languages for some time; unfortunately, this is kind of an esoteric area of CS research and online resources about programming with uniqueness types are few and…
15
votes
3 answers

Parallelism implies concurrency but not the other way round right?

I often read that parallelism and concurrency are different things. Very often the answerers/commenters go as far as writing that they're two entirely different things. Yet in my view they're related but I'd like some clarification on that. For…
Cedric Martin
  • 1,067
  • 10
  • 16
14
votes
2 answers

Time Complexity of Parallel.ForEach

Pseudo code and comments to explain: // first select companies to process from db foreach (company) { // select the employees foreach (employee of company) { // select items they can access foreach (item) { // do…
Jesse Q
  • 251
  • 2
  • 6
13
votes
5 answers

Why is implicit parallelism/concurrency not more widespread?

Implicit parallelism^ can take a big burden away from many programmers, placing it on the computer. So... why is it is not more widespread at present? ^ Implicit parallelism is to make a computer be able to figure out itself how to do more than one…
Abbafei
  • 821
  • 6
  • 17
13
votes
1 answer

Best practise is not to poll...but isn't polling happening internally anyway when a thread calls wait()?

Say we have some thread that wants to check when another thread is finished its task. I have read that we should call a wait() type function that will make this thread wait until it receives a notification that the other thread is finished. And that…
csss
  • 231
  • 2
  • 5
12
votes
2 answers

What would be the best way to handle errors in parallel programs?

With parallel algorithms knocking at the door, it might be a good time to think about error handling. So at first there were error codes. Those sucked. It was free to ignore them, so you could fail late and produce hard-to-debug code. Then came…
zneak
  • 2,556
  • 2
  • 23
  • 24
11
votes
4 answers

What is Java's primary focus? Why does it take so long to get new features?

I have been exploring the new features in the JDK8, like the lambda expressions, the extension methods, and the new stream API. Evidently none of these features are new in the programming world and that made wonder why are getting all these things…
edalorzo
  • 2,634
  • 1
  • 19
  • 28
10
votes
2 answers

Why do programmers define programming models to replace C/POSIX for parallelism?

Providers of new computer architectures regularly try to introduce new programming models, e.g. recently CUDA/OpenCL for GPGPUs, and displace C/POSIX as the control interface to platform parallelism. (Poss & Koening, AM3: Towards a hardware…
Mehdi Haghgoo
  • 237
  • 1
  • 5
9
votes
1 answer

Prolog parallelism

Are there any prolog interpreters that can functionally decompose your 'programs' in order to improve efficiency? I know there's been research on prolog interpreters that reach near-C speeds through parallelism (the kind that a typical C programmer…
David Cowden
  • 2,903
  • 17
  • 23
1
2 3 4 5 6 7