当前位置:网站首页>The difference between parallelism and concurrency
The difference between parallelism and concurrency
2022-07-06 17:53:00 【TABE_】
Here's the catalog title
parallel
parallel (Parallel), When the system has more than one CPU when , When one CPU When executing a process , the other one CPU Another process can be executed , The two processes do not preempt each other CPU resources , You can do it at the same time , This way we call parallel (Parallel).
In fact, the determinant of parallelism is not CPU The number of , It is CPU The number of cores , For example, a CPU Multiple cores can also be parallel .
Concurrent
Concurrent (Concurrent), In the operating system , It means that several programs in a period of time are between the start and the completion of running , And these programs are all running on the same processor .
Concurrency is not really “ At the same time ”, It's just CPU Divide a time period into several time segments ( Time interval ), And then switch back and forth between these time intervals , because CPU The processing speed is very fast , As long as the time interval is handled properly , It makes users feel that multiple applications are running at the same time . Such as : Playing games and listening to music are both completed from the beginning to the end on the same computer in the same time period . that , It can be said that listening to music and playing games are concurrent .
The difference between concurrency and parallelism
Concurrent , It refers to multiple things , It happened at the same time . parallel , It refers to multiple things , At the same time .
Multiple concurrent tasks preempt each other's resources . Parallel tasks do not preempt each other's resources .
Concurrency is that multiple programs run simultaneously in a period of time , Parallelism is at some point , There are really multiple programs running .
Only in many CPU Or a CPU In the case of multicore , It's going to happen in parallel . otherwise , What seems to happen at the same time , In fact, they are all concurrent .
边栏推荐
- SQL statement optimization, order by desc speed optimization
- Nodejs 开发者路线图 2022 零基础学习指南
- Xin'an Second Edition; Chapter 11 learning notes on the principle and application of network physical isolation technology
- OpenCV中如何使用滚动条动态调整参数
- Vscode replaces commas, or specific characters with newlines
- Hongmeng introduction and development environment construction
- There is a gap in traditional home decoration. VR panoramic home decoration allows you to experience the completion effect of your new house
- FlutterWeb瀏覽器刷新後無法回退的解决方案
- OliveTin能在网页上安全运行shell命令(上)
- [translation] principle analysis of X Window Manager (I)
猜你喜欢
FlutterWeb浏览器刷新后无法回退的解决方案
Grafana 9 正式发布,更易用,更酷炫了!
Getting started with pytest ----- allow generate report
一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升
kivy教程之在 Kivy 中支持中文以构建跨平台应用程序(教程含源码)
How to solve the error "press any to exit" when deploying multiple easycvr on one server?
The easycvr authorization expiration page cannot be logged in. How to solve it?
Getting started with pytest ----- test case pre post, firmware
Manifest of SAP ui5 framework json
Pytorch extract middle layer features?
随机推荐
[rapid environment construction] openharmony 10 minute tutorial (cub pie)
Pyspark operator processing spatial data full parsing (4): let's talk about spatial operations first
How to submit data through post
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
李书福为何要亲自挂帅造手机?
在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
PyTorch 提取中间层特征?
Nodejs 开发者路线图 2022 零基础学习指南
VR panoramic wedding helps couples record romantic and beautiful scenes
How to output special symbols in shell
The NTFS format converter (convert.exe) is missing from the current system
Interview shock 62: what are the precautions for group by?
node の SQLite
学 SQL 必须了解的 10 个高级概念
MySQL stored procedure
Getting started with pytest ----- test case pre post, firmware
OliveTin能在网页上安全运行shell命令(上)
PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
Mysqlimport imports data files into the database
BearPi-HM_ Nano development environment