当前位置:网站首页>User level threads and kernel level threads
User level threads and kernel level threads
2022-06-29 09:39:00 【KingOfMyHeart】
Threading model
One to one thread model

Many to one threading model

N Yes M Thread model of

There are two ways to implement threads
User-level threads
Implement thread instances in user mode , Use one TCB(Thread Control Block) To describe a user thread , The TCB Stored in user mode .
- The kernel can't see the user level thread , For the kernel , You can only see the current process , Threads created in the current process cannot be scheduled by the operating system ;
- User level thread creation , The destruction , And switching is extremely fast , There is no need to switch back and forth between user mode and kernel mode ;
- When a user thread blocks or gets stuck in the kernel , Now the whole process will be blocked , Other user threads will not be able to use ( Consider using asynchronous invocation to mitigate );
- All user threads in the process need to actively give up CPU, Otherwise, it will CPU The time slice is gone , Because for the kernel , You can only see the process , Only time slices can be assigned to the current process ;
- Each process can customize the thread scheduling algorithm .
User level threads are implemented by thread libraries in some applications .
Kernel level threads
Implement thread instances in kernel mode , Use one TCB(Thread Control Block) To describe a user thread , The TCB Stored in kernel mode , The kernel can directly perform scheduling management .
- Thread creation , The overhead of termination and switching is large , It is all done by the kernel ;
- The kernel is aware of threads , Managed by the operating system , Scheduled by the operating system ;
- The allocation of kernel time slice is based on threads , The kernel allocates an entire slice of time to threads .
coroutines
coroutines = User-level threads + Scheduler
边栏推荐
- Five heart charity matchmaker team
- UE4 蓝图修改Array 中Get a copy 为 reference
- 云管理平台:9大开源云管理平台(CMP)
- ISO16000-9建筑产品和家具中挥发性有机物的测试
- 转载 :判断对象是否具有属性的5种方法
- 你知道BFD是什么吗?一文详解BFD协议原理及使用场景
- The former security director of Uber faced fraud allegations and concealed the data leakage event
- Detailed version of two-stage target detection principle
- 云管理平台:OpenStack架构设计及详细解读
- Pytorch summary learning series - data manipulation
猜你喜欢

Print service IP setting scheme

数据处理时代,数据质量建设才是企业的生存之道

Mysql配置主从数据库

The principle of session and cookie

GD32F4xx 以太網芯片(enc28j60)驅動移植

Making of simple addition calculator based on pyqt5 and QT Designer

Write down some written test questions

基于keil5自动配置stm32f103标准库的官网freertos移植

SSD improvements cfenet

3DMax 卡死、白屏、渲染死机问题总结
随机推荐
Detecting and counting tiny faces
pytoch总结—TENSOR 和NUMPY相互转换
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(五)
pytorch总结学习系列-广播机制
In the future of Business Intelligence BI, how do you view the ai+bi model?
Pytorch summary learning series - broadcast mechanism
Wechat applet wx Navigateback returns the parameters carried on the previous page
Gd32f4xx Ethernet chip (ENC28J60) driver migration
Wechat applet sub components transfer values to the page (communication between parent and child components) with source code
Wechat applet custom multi selector
LeetCode刷题——泰波那契数列
基于stm32标准库独立按键的多按键状态机的实现
HB5470民用飞机机舱内部非金属材料燃烧测试
Laravel 8 enables the order table to be divided by month level
pytorch总结学习系列-数据操作
UE4 VS的Visual Assist插件设置
What is hyperfusion? What is the difference with traditional architecture
股票炒股账号开户安全吗?是靠谱的吗?
UE4 去掉材质中Mask透明白边
基于keil5自动配置stm32f103标准库的官网freertos移植