当前位置:网站首页>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 .
边栏推荐
猜你喜欢

DocuWare 移动劳动力解决方案可帮助您构建新的生产力模式:随时随地、任何设备

Intel introduces you to visual recognition -- openvino

Principle and usage setting of large page memory

一篇万字博文带你入坑爬虫这条不归路 【万字图文】

北京护照西班牙语翻译推荐

Google Play APK 上传其他国际应用商店

Plato launched the LAAS protocol elephant swap, which allows users to earn premium income

Day2: 130 questions in three languages

18张图,直观理解神经网络、流形和拓扑

Day2:三种语言暴刷牛客130题
随机推荐
Bracket matching test
Synchronized keyword details
ThinkPHP high imitation blue cloud disk system program
“index [hotel/jXLK5MTYTU-jO9WzJNob4w] already exists“
[Jenkins' notes] introduction, free space; Continuous integration of enterprise wechat; Allure reports, continuous integration of email notifications; Build scheduled tasks
Day2: 130 questions in three languages
redis安装,集群部署与常见调优
Learning summary of time complexity and space complexity
表达式求值
【ManageEngine】局域网监控软件是什么,有什么作用
(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
Digital twin rail transit: "intelligent" monitoring to clear the pain points of urban operation
vm options、program arguments、environment property
QT static compiler (MinGW compilation)
正则表达式
Recursion and divide and conquer
时间复杂度、空间复杂度的学习总结
Self made | a 16 bit RISC architecture CPU is self-made by hand
对接支付宝支付
(完美解决)为什么在train/val/test数据集上用train模式效果都很好,但是在eval模式下全部很差