2 ms·
concurrency: pretending to do multiple things at the same time parallelism: actually doing multiple things at the same time Mostly, the distinction is useful
by tbrownaw 11y ago
concurrency: pretending to do multiple things at the same time
parallelism: actually doing multiple things at the same time
Mostly, the distinction is useful if you want to paper over slow I/O without making sure your algorithms can actually run efficiently spread over multiple cores.
- adrusi 11y agoConcurrency isn't pretending to do multiple things at the same time, it's the concept of multiple things happening at once. Concurrency doesn't necessarily involve parallel computation. Concurrency is just when you think about something as multiple things happening at once. This includes parallel computation, as well as premptive multitasking on a single CPU, as well as cooperative multitasking (including in green threads). It also includes coroutines, and the notion of an "iterator". Arguably dealing with time is also concurrency because it weave your program's thread of execution with the thread of time.