Book review: Is parallel programming hard, and, if so, what can you do about it?
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
Book review: Is parallel programming hard, and, if so, what can you do about it?
Unofficial Hacker News client; not affiliated with Y Combinator.
criddell · · focus · HN ↗
As I understand it, the parallelism is about task execution and concurrency is about task structure. Or, as Rob Pike said:
"Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once."
He said that in his Concurrency is not Parallelism talk.
ahelwer · · focus · HN ↗
In the end I don't think it is too much of an issue. What confusion is really brought by conflating parallelism and concurrency? Sure, concurrent programs can be serialized onto a single core (that's how deterministic simulation testing implementations like Antithesis and record & replay implementations like Mozilla's rr operate). But there isn't some deep conceptual unlock you get by having a strict conceptual boundary between concurrency and parallelism.
Athas · · focus · HN ↗
I agree that this distinction is hardly universal, but it seems to be growing increasingly established, and I think it is worth fighting for it.
convolvatron · · focus · HN ↗
so I find saying that we have one or the other to pretty misleading.
gpderetta · · focus · HN ↗
And even with deterministic scheduling, concurrency might be dictated by external stimuli (for example request arrival) that are not deterministic.
convolvatron · · focus · HN ↗
so our job is really to kind of look at all the possible topological sorts of that 'after' ordering, and ensure that they are all correct, and if not, add additional edges by using locks or whatever mechanism.
kind of more interested are techniques like mvcc and crdt, which make _any_ causal ordering of events (topo sort) result in a meaningful answer.
but if you look at classical simd for example, we have concurrency (and parallelism) without additional constraints, because the threads are strongly synchronized at the hardware level.
gpderetta · · focus · HN ↗
[deleted] · · focus · HN ↗
[deleted]
jerf · · focus · HN ↗
packetlost · · focus · HN ↗
If this distinction wasn't important, Python's infamous GIL would not be an issue.
kccqzy · · focus · HN ↗
Dylan16807 · · focus · HN ↗
And it's worth talking about how you can have a single task run in a parallel way, for varying strictness of 'single'.
Coroutines and SIMD are far enough apart that their execution models should have different words.