Key words: have a meal, make a phone call, take milk

If someone calls me while I’m eating, and I can only answer the phone after EATING, then I don’t support parallelism and concurrency.

If someone calls me while I’m eating, I answer the phone first, and then I continue eating, then I support concurrency.

If someone calls while I’m eating, and I answer the phone while I’m eating, I’m for parallelism.

Or to put it another way: you’re nursing two babies at the same time.

Feeding two children alternately with one milk is called concurrent feeding.

Feeding two babies with two milk is called parallel feeding.

I used to have trouble distinguishing parallel from concurrent, but when I think about it, the difference is pretty clear.

Concurrency is basically both, there’s no requirement that they all happen at the same time, they can alternate.

Parallelism is to go together, and it requires that both things be executed at the same time.

In addition, concurrency requires different things to happen in the same entity, and parallelism requires different things to happen in different entities.

For example, if a core wants to run several threads, they can only run concurrently, allowing them to rotate quickly, and when the change is not perceived by the human, it looks like simultaneous, but in reality it is not simultaneous.

And multiple cores want to run multiple tasks can be executed, one to execute this thread, one to execute that thread, you can achieve parallelism.