4 ms·
> All concurrency is parallelism, but not all parallelism is concurrency As sibling notes, you have it exactly backwards. It should read "All parallelism is co
by throwaway894345 2y ago
> All concurrency is parallelism, but not all parallelism is concurrency
As sibling notes, you have it exactly backwards. It should read "All parallelism is concurrency, but not all concurrency is parallelism." I thought maybe this was a typo, but then you said:
> If you just think of concurrency as an instance of parallelism, you start to realize there are many ways to achieve concurrency, and thread-safe queues are one of the better ways to do it.
This is demonstrating parallelism as an instance of concurrency, not the other way around. A thread-safe queue can be processed by multiple tasks running interleaved in a single thread in which case it is executing concurrently, but not in parallel.
> Individual CPU cores are parallel because they are executing multiple instructions simultaneously
This is an implementation detail of the CPU. Not all CPUs execute instructions in parallel.