当前位置:网站首页>Parallelism and concurrency
Parallelism and concurrency
2022-07-22 09:14:00 【Ugly and ugly】
We all know , In the dimension of operating system , Thread is CPU The smallest unit of allocation .
Parallelism is the same time , Both threads are executing . This requires two CPU To execute two threads separately . It can be understood as two CPU Service two threads , Threads and servers are one-to-one .
Concurrency is the same time , There's only one execution , But for a period of time , Both threads execute . The implementation of concurrency depends on CPU Switching thread , Because the switching time is very short , Therefore, it is basically imperceptible to users . You can think of it as one CPU Serving two threads ,CPU Switch back and forth between two threads .
The essence of concurrency is a physics CPU( It can also be multiple Physics CPU) Multiplexing between several programs , Concurrency is to enforce multi-user sharing of limited physical resources to improve efficiency .
Parallelism refers to two or more events or activities occurring at the same time , In a multiprogramming environment , Parallelism enables multiple programs to work at different times at the same time CPU At the same time .
For example, go to the canteen to cook , Parallel is to learn from multiple students and eat at the same time in multiple windows , Concurrency means that multiple students are eating at the same time in the same window .
Parallelism requires two or more threads running on different processors , Concurrency can be switched on a processor through time slices .
边栏推荐
- 一种图片选择自定义控件
- Implementation of recommendation system collaborative filtering in spark
- cocoapod安装问题
- 无法打开“xxx”,因为无法确认开发者的身份。 或者说什么文件已损坏解决方法
- Guan Zhengxiong: implement QA generation algorithm based on pre training model and intelligent operation and maintenance
- Sed, stream editor and VIM editor.
- 华泰证券渠道开户安全吗,怎么看是不是正规
- SQL子查询
- 一道数据库查询面试题
- JVM 简介
猜你喜欢
随机推荐
Rewrite dispatchtouchevent to realize the function of playing picture lock
Thinking of data storage scheme based on sub database and sub table
给OES纹理添加雪花特效
solo 文章 推送到社区端失败
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
分库分表的数据存储方案思路
我心目中理想的“元宇宙”
2021-09-23
JDBC事务操作
用unshift向对象数组中添加一个元素
solo 文章中插广告不显示
Writing of Samsung 6818led driver
Writing of Samsung 6818 chip flame alarm driver
CopyOnWriteArrayList 浅析
OC 设置图片圆角 图片不变形等问题
Single cell paper record (Part18) -- spectral clustering based on learning similarity matrix
浏览器类型判断
创建线程池的七种方式
Some notes of MySQL
迷你考试-考试系统