当前位置:网站首页>What is the difference between concurrency and parallelism?

What is the difference between concurrency and parallelism?

2022-06-24 00:01:00 The fifth brother of the Wang family

Concurrent : Two or more events occur at the same time interval .

parallel : Two or more events occur at the same time .

Parallelism is really , Do many things at the same time , Concurrency can only do one event at a time , It's just that you can chop up time , Do many things alternately .

There is an example on the Internet, which is very vivid :

You eat half of your meal , Here's the phone , You don't pick up until you've finished eating , This means that you don't support concurrency or parallelism .

You eat half of your meal , Here's the phone , You stop and answer the phone , After that, continue to eat , This means that you support concurrency .

You eat half of your meal , Here's the phone , You're eating while you're on the phone , This shows that you support parallel .

原网站

版权声明
本文为[The fifth brother of the Wang family]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206232121148791.html