当前位置:网站首页>Differences between lock spin and mutex usage scenarios
Differences between lock spin and mutex usage scenarios
2022-07-30 11:18:00 【a Explorer】
Under a single-core CPU, spin lock is meaningless and will only affect the normal thread response; although using mutex will switch between the two queues of "suspend" and "running", it improves the overall response ratio of the system.
Under multi-core CPU, the polling time of spin lock on multiple and cores is negligible. Using spin lock avoids time consumption caused by queue switching.
The practice of modern operating systems, in a multi-core environment, when implementing mutex, if the lock operation is performed, the polling (spin lock) is performed. After this period of time, the traditional mutex is used to block (join pendingqueue).If the program is predictably blocked for a short time, spin lock can be actively used.
边栏推荐
猜你喜欢

RandLA-Net复现记录

360 released a future-oriented EDR to protect the security of government and enterprise user terminals in an all-round way

Linux内核设计与实现(十)| 页高速缓存和页回写

我又造了个轮子:GrpcGateway

MySQL——数据库基础

HJY-F931A/YJ three-phase voltage relay

TestNg整合Retry代码

Telerik2022 R2,有效的自动化测试

RY-D1/1 Voltage Relay

stm32 RTC闹钟唤醒低功耗模式
随机推荐
360 released a future-oriented EDR to protect the security of government and enterprise user terminals in an all-round way
"Learning Cloud Networking with Teacher Tang" - Problem Location - The host is working but the container is not working
unity3d C#语言基础(继承)
从数据流中快速查找中位数
Assembly to implement bubble sort
电压跟随器不要随便加
STM32F1读取MLX90632非接触式红外温度传感器
STM32F1 reads MLX90632 non-contact infrared temperature sensor
@RequestBody 和 @ResponseBody 详解
Jingdong school recruited written test questions + summary of knowledge points
The package of idea is not hollow
oracle 导出dmp文件类型为“故障转储文件”
易基因:人类tRNA基因位点表现出与衰老相关的DNA高甲基化|研究文章
【C和指针第七章】可变参数列表
ESP32CAM 1838接收红外遥控器信号
Taobao/Tmall taobao comments q&a list interface API
【Flume】batchSize和transactionCapacity区别
VLAN实验
Database transactions, JDBC operations and data types
加密和安全