Hacker News
Rob Pike – 'Concurrency Is Not Parallelism' [video] (2012)
abetusk
|next
[-]
Parallelism is running processes at the same time.
The driving motivation behind concurrency, as far as I can tell, is that it's a concept that can help reason about complex tasks with the added benefit of being able to take advantage of parallelism.
My problem with Pike's advocacy for concurrency, and Golang in particular, is that it's an abstraction that imposes a world view on what's a good programming paradigm and, more practically, how to take advantage of parallelism, both of which have limited utility compared with considering parallelism directly.
My opinion rather than some abstraction that imposes a world view on how to take advantage of parallelism, it's better to use how people actually take advantage of parallelism as a basis for abstraction.
I think Golang is a fine language but we now have 14+ years of hindsight to see how well it's fared and how much it's influenced the compute landscape. In my opinion, the "concurrency not parallelism" misses the simple issue that we want things to go fast. Which has had more influence, Golang's idea of concurrency or taking advantage of GPU parallelism? I think the answer is clearly taking advantage of GPU parallelism.
zamalek
|root
|parent
|next
[-]
This is called preemptive multitasking. This is like declaring that "sorting a list is quicksort." This can realize concurrency.
The reason that this is important is that cooperative multitasking (async/cps/fibers/safe points) is also concurrency. And I'm sure there are other exotic forms of concurrency that I'm not aware of beyond multitasking.
Concurrency is a property of a program/system, not a mechanism.
neerajdotname2
|root
|parent
|next
|previous
[-]
CyberDildonics
|root
|parent
|previous
[-]
Having one way built into the language is like a language using a hash map for everything. It might be convenient when it works, but the idea that there is one best way is only a little better than people fumbling their way through it from scratch.
abetusk
|root
|parent
[-]
One benefit of a programming paradigm is that it can allow for an increase in speed of software development at a marginal cost of run-time efficiency, but if the paradigm is so out of step with the underlying hardware, the run-time efficiencies can be orders of magnitude slower than a bespoke way.
Standardization and abstraction are most effective when there is data about which bespoke ways work the best. Choosing standardization and abstraction before experimenting on the solution space rarely works well.
cassianoleal
|next
|previous
[-]
kmlx
|root
|parent
|next
|previous
[-]
> This video is not rated
> Join vimeo to watch
> Already have an account? Log in
davydm
|root
|parent
|previous
[-]
cassianoleal
|root
|parent
[-]
Funnily enough, yt-dlp has no trouble downloading it.
davydm
|root
|parent
|previous
[-]
In much the same vein, I rarely actually watch stuff _on_ netflix, through a browser - I watch sped up, and the quality just degrades. Since I pay for it, I feel nothing for downloading a ripped copy to watch it locally :D
bjoli
|next
|previous
[-]
I sometimes wonder where we would be now if people would have gone "Wow, mr Reppy! concurrentML is so cool!" in 1993.
instead we got pthreads and collective amnesia and later we got go's girly times and channels which are only half way there.
kllrnohj
|root
|parent
|next
[-]
What is useful is the state machine aspects of things like coroutines or async/await, but those aren't quite fibers and very much aren't M:N threading. A major use of them is in UI where they have strict thread requirements even.
freedomben
|root
|parent
|next
[-]
State machine/management is really what is most useful
bjoli
|root
|parent
|previous
[-]
i rarely write gui stuff and I find async is rarely what I need. in f# I at least have the option to use hopac.
BobbyJo
|root
|parent
|next
|previous
[-]
It also became a cycle: People write single threaded code -> CPUs/OSs optimize performance/ergonomics for single threaded programs -> People write single threaded code ->...
It wasn't until scaling slowed down that interest/investment in concurrency/parallelism took off.
mattrighetti
|next
|previous
[-]
em-bee
|root
|parent
[-]
you also want to open the slides and run them in parallel because the video doesn't show them very well. the slides are linked in the youtube description, but i don't see them linked on vimeo: https://talks.golang.org/2012/waza.slide
petilon
|next
|previous
[-]
davydm
|next
|previous
[-]
concurrency _is_ parallelism, but for I/O. People often think of parallelism for the case of making something go faster - eg placing two computations in parallel (the definition posed in the video), OR placing two I/O operations in parallel - so this is the keyboard-vs-mouse in the OS, even when you're on one core only; this is multiple web requests in JavaScript, which does not support multi-threading, but 100% does support concurrency for I/O operations - that... badum-tiss! RUN IN PARALLEL.
I get the point of the talk, and it's well interesting, but I think it depends on how one views things.
pdpi
|root
|parent
|next
[-]
Not really. They're just separate but related concepts.
E.g. coroutines are a form of concurrency that doesn't have to involve any sort of I/O, you're just taking two logical processes (e.g generating a sequence and consuming it) and abstracting away how they execute relative to each other.
Describing your tasks using the language of concurrency is a requirement for process-based parallelism (multiple CPUs/cores), but data-level parallelism (SIMD) is a form of parallelism that doesn't involve concurrency either.
threatofrain
|root
|parent
[-]
- the program is decomposable into partially ordered or unordered units of execution
- the program result remains determinant despite partial ordering
Your data-level parallelism is taking advantage of the concurrent properties of a problem.
lelandbatey
|root
|parent
|previous
[-]
quietbritishjim
|root
|parent
[-]
There's no actual guarantee in the API that if you spawn multiple threads and call blocking network I/O that those happen literally simultaneously. Maybe the OS has a big mutex on network I/O to serialise them.
Of course, that's not what happens in practice. But neither is it what happens, in practice, to async network APIs called concurrently in one thread. So I don't think that can be the difference between concurrent and parallel.