当前位置:网站首页>Subtotal of process thread coordination
Subtotal of process thread coordination
2022-07-29 01:24:00 【:D...】
Catalog
One 、 process Threads coroutines
A process is a unit of resource allocation ;
Thread is CPU Dispatch unit ;
coroutines , Also called tasklet , fibers ; Coroutine is a lightweight thread in user mode
Two 、 The difference between a process and a thread
- address space : A thread is an execution unit in a process , There is at least one thread in the process , They share the address space of the process , The process has its own address space
- Resource ownership : Processes are units of resource allocation and ownership , Threads in the same process share the resources of the process
- Thread is cpu The basic unit of processor scheduling , But the process is not
- Both can be executed concurrently
- Each independent thread has an entry for the program to run 、 Exit of sequential execution sequence and program , But threads can't execute independently , Must exist in the application , Multiple thread execution control provided by the application
3、 ... and The difference between threads and coroutines :
Thread switching will be saved to CPU In my stack , It has its own register context and stack
The main function of a coroutine is to achieve concurrency under the condition of a single thread , But it's actually serial ( image yield equally )
- A thread can have more than one process , A process can also have multiple collaborations alone .
- Thread processes are all synchronization mechanisms , And the process is asynchronous .
- The process can keep the state of the last call , Every time the process reenters , It's equivalent to entering the state of the last call .
4) Threads are resources of coroutines . The agreement passed Interceptor To use the thread resource indirectly .
边栏推荐
- 线程锁及锁的升降级
- 【SQL之降龙十八掌】01——亢龙有悔:入门10题
- (perfect solution) why is the effect of using train mode on the train/val/test dataset good, but it is all very poor in Eval mode
- 测试/开发程序员靠技术渡过中年危机?提升自己本身的价值......
- 20220728 sorting strings that are not pure numbers
- The digitalization of the consumer industry is upgraded to "rigid demand", and weiit's new retail SaaS empowers enterprises!
- Rewriting method set
- Summary of process and thread knowledge points 1
- Summary of process and thread knowledge points 2
- Naver three party login
猜你喜欢

Spark 3.0 中七个必须知道的 SQL 性能优化

SystemVerilog join and copy operators

教你一文解决 js 数字精度丢失问题

可视化全链路日志追踪
![[MySQL] historical cumulative de duplication of multiple indicators](/img/22/1d5162e2c9636c9455138f2f39d150.png)
[MySQL] historical cumulative de duplication of multiple indicators

大页内存原理及使用设置

Google play APK uploads other international app stores

How to smoothly go online after MySQL table splitting?

Recursion and divide and conquer

Consumer unit
随机推荐
How to check the redis Version (check the redis process)
一文搞懂ES6基本全部语法
Consumer unit
How to create a custom 404 error page in WordPress
Principle and usage setting of large page memory
Thread lock and its ascending and descending levels
SDRAM Controller Design (two design methods of digital controller)
The digitalization of the consumer industry is upgraded to "rigid demand", and weiit's new retail SaaS empowers enterprises!
Linux Redis 源码安装
TextKit 自定义UILabel识别链接
Summary of process and thread knowledge points 2
Flask project architecture (First Edition
Django使用MySQL数据库已经存在的数据表方法
可视化全链路日志追踪
Docker-compose安装mysql
“index [hotel/jXLK5MTYTU-jO9WzJNob4w] already exists“
JS judge whether array / object array 1 contains array / object array 2
大页内存原理及使用设置
括号匹配的检验
APP接入Kakaotalk三方登录