←back to thread

289 points kristoff_it | 6 comments | | HN request time: 0.008s | source | bottom
Show context
threatofrain ◴[] No.44609107[source]
IMO the author is mixed up on his definitions for concurrency.

https://lamport.azurewebsites.net/pubs/time-clocks.pdf

replies(4): >>44609321 #>>44609563 #>>44610163 #>>44611854 #
tines ◴[] No.44609321[source]
Can you explain more instead of linking a paper? I felt like the definitions were alright.

> Asynchrony: the possibility for tasks to run out of order and still be correct.

> Concurrency: the ability of a system to progress multiple tasks at a time, be it via parallelism or task switching.

> Parallelism: the ability of a system to execute more than one task simultaneously at the physical level.

replies(9): >>44609334 #>>44609420 #>>44609491 #>>44609531 #>>44609532 #>>44609822 #>>44609915 #>>44610273 #>>44611918 #
Lichtso ◴[] No.44609531[source]
Concurrency is parallelism and/or asynchrony, simply the superset of the other two.

Asynchrony means things happen out of order, interleaved, interrupted, preempted, etc. but could still be just one thing at a time sequentially.

Parallelism means the physical time spent is less that the sum of the total time spent because things happen simultaneously.

replies(3): >>44609697 #>>44610257 #>>44613039 #
1. jrvieira ◴[] No.44609697[source]
careful: in many programming contexts parallelism and concurrency are exclusive concepts, and sometimes under the umbrella of async, which is a term that applies to a different domain.

in other contexts these words don't describe disjoint sets of things so it's important to clearly define your terms when talking about software.

replies(2): >>44609817 #>>44609977 #
2. merb ◴[] No.44609817[source]
Yeah concurrency is not parallelism. https://go.dev/blog/waza-talk
replies(1): >>44610041 #
3. Lichtso ◴[] No.44609977[source]
yes, some people swap the meaning of concurrency and asynchrony. But, almost all implementations of async use main event loops, global interpreter lock, co-routines etc. and thus at the end of the day only do one thing at a time.

Therefore I think this definition makes the most sense in practical terms. Defining concurrency as the superset is a useful construct because you have to deal with the same issues in both cases. And differentiating asynchrony and parallelism makes sense because it changes the trade-off of latency and energy consumption (if the bandwidth is fixed).

4. Lichtso ◴[] No.44610041[source]
That is compatible with my statement: Not all concurrency is parallelism, but all parallelism is concurrency.
replies(2): >>44610270 #>>44614508 #
5. OkayPhysicist ◴[] No.44610270{3}[source]
What people mean by "concurrency is not parallelism" is that they are different problems. The concurrency problem is defining an application such that it has parts that are not causally linked with some other parts of the program. The parallelism problem is the logistics of actually running multiple parts of your program at the same time. If I write a well-formed concurrent system, I shouldn't have to know or care if two specific parts of my system are actually being executed in parallel.

In ecosystems with good distributed system stories, what this looks like in practice is that concurrency is your (the application developers') problem, and parallelism is the scheduler designer's problem.

6. jlouis ◴[] No.44614508{3}[source]
SIMD is parallel execution with no concurrency.