当前位置:网站首页>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 .
边栏推荐
- Learning summary of time complexity and space complexity
- “index [hotel/jXLK5MTYTU-jO9WzJNob4w] already exists“
- ThinkPHP high imitation blue cloud disk system program
- Plato launched the LAAS protocol elephant swap, which allows users to earn premium income
- Hilbert 变换与瞬时频率
- Visual full link log tracking
- 18张图,直观理解神经网络、流形和拓扑
- 一篇万字博文带你入坑爬虫这条不归路 【万字图文】
- How to deal with the time, scope and cost constraints in the project?
- Canal实时解析mysql binlog数据实战
猜你喜欢

How to smoothly go online after MySQL table splitting?

【idea】查询字段使用位置

mysql 创建索引的三种方式

Summary of process and thread knowledge points 2

如何执行建设项目的时间影响分析?

How to implement the time impact analysis of the construction project?

Linux Redis 源码安装

Solid smart contract tutorial (5) -nft auction contract

mysql分表之后怎么平滑上线?

Day2: 130 questions in three languages
随机推荐
Plato launched the LAAS protocol elephant swap, which allows users to earn premium income
RHCE命令练习(二)
如何处理项目中的时间、范围和成本限制?
Date conversion EEE MMM DD hh:mm:ss zzz YYYY
Flink Postgres CDC
Hilbert 变换与瞬时频率
Canal real-time parsing MySQL binlog data practice
Principle and usage setting of large page memory
Instruction rearrangement, happens before, as if serial
【SQL之降龙十八掌】01——亢龙有悔:入门10题
一篇万字博文带你入坑爬虫这条不归路 【万字图文】
正则校验与时间格式化
大页内存原理及使用设置
Mathematical modeling and detailed explanation of basic knowledge (common knowledge points of Chemistry)
线程锁及锁的升降级
Recursion and divide and conquer
App access kakaotalk three party login
DocuWare 移动劳动力解决方案可帮助您构建新的生产力模式:随时随地、任何设备
mysql 创建索引的三种方式
【mysql】多指标历史累计去重问题