3 ms·
You can have concurrency with one CPU but you can't have parallelism with one CPU. Concurrency is the ordering and dependency (or lack of) between two (or more
by ww520 12y ago
You can have concurrency with one CPU but you can't have parallelism with one CPU.
Concurrency is the ordering and dependency (or lack of) between two (or more) paths of executions. Parallelism is the doing of work in parallel. They describe two different things. A program can be either concurrent only, parallel only, or both, and there's where the confusion come in.
- _greim_ 12y ago> you can't have parallelism with one CPU What about multithreading? If a single core switches between tasks I can see that not being true parallelism, but what about multi core?
- curryhoward 12y agoYou're technically right (multi-core CPUs can do true parallelism), but you were downvoted probably because your point was obvious (to the people who downvoted you). A multi-core CPU is basically multiple CPUs. The details (multicores share the same die, use the same caches, etc.) are mostly irrelevant here.
- ww520 12y agoMultithreading on a single CPU doesn't have parallelism. You are just switching between tasks very fast serially. A multi-core CPU for all intents and purposes has multiple CPU's. For the discussion on concurrency and parallelism, the distinction is on one execution unit vs multiple execution units.
- lloeki 12y ago> Multithreading on a single CPU doesn't have parallelism. You are just switching between tasks very fast serially. Nitpick: SMT[0] (implemented as Hyper-Threading by Intel) is in fact parallelism for threads on a single CPU. [0]: http://en.wikipedia.org/wiki/Simultaneous_multithreading http://en.wikipedia.org/wiki/Simultaneous_multithreading