Yet another blog post about how parallelism is not concurrency
composition.al
composition.al
http://joearms.github.io/2013/04/05/concurrent-and-parallel-...
How do you figure? From TFA:
> A lot of software systems are useful to reason about as having multiple threads of control — for instance, separate clients connecting to a server, or separate UI widgets. Programs that are organized this way exhibit concurrency. The fact that multiple threads of control are a good way of organizing and reasoning about certain programs is orthogonal to whether those programs are running on one processor core or four or 1000.
One queue of people executing the "get espresso from the coffee machine" routine and another queue executing the "get drip coffee from the coffee machine" routine seems like concurrency to me. Two different routines are competing for the use of a single resource, but neither routine needs to know about the other -if we presume that there's a work scheduling system in place-.
What's more, this trivially gives way to parallelism: add another coffee machine (which is analogous to another CPU core) and assign one of the queues to that machine. BAM! Instant parallelism.
What am I misunderstanding here?
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.
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.