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

The battle-hardened programmer was also deceived by a fake programmer from a certain fish. The trust between programmers should be the highest, and he alone destroyed this sense of trust
![[Qualcomm][Network] 网络拨号失败和netmgrd服务分析](/img/76/49054ff8c7215eca98cc479ab1d986.png)
[Qualcomm][Network] 网络拨号失败和netmgrd服务分析

数据库性能系列之索引(上)

干货|语义网、Web3.0、Web3、元宇宙这些概念还傻傻分不清楚?(中)

【ASP.NET Core】选项类的依赖注入

jmeter接口压力测试-(二)

GBJ2510-ASEMI电机专用25A整流桥GBJ2510

MySQL——数据库基础

鸿湖万联扬帆富设备开发板正式合入OpenHarmony主干

AB test summary
随机推荐
vscode中写markdown格式笔记的配置过程和相关语法
Native js create table
Telerik2022 R2,有效的自动化测试
[ASP.NET Core] Dependency Injection for Option Classes
pg_rewind 修复主备环境的时间线
AIX shell获取前几个月时间
鸿湖万联扬帆富设备开发板正式合入OpenHarmony主干
【HarmonyOS】【ARK UI】HarmonyOS ets语言怎么实现双击返回键退出
获取1688app上原数据 API
MySQL之数据库维护
【 HMS core 】 【 Analytics Kit] [FAQ] how to solve the payment amount in huawei pay analysis shows zero problem?
360闷声干大事获赞无数,数字安全如何保障?还得看企业安全云
电压继电器HDY-A/1-220VAC-1
log4js入门
How to add data to the request header when feign is called remotely
Hu-cang integrated e-commerce project (1): project background and structure introduction
High energy output!Tencent's internal MyCat middleware manual, both theoretical and practical
干货|语义网、Web3.0、Web3、元宇宙这些概念还傻傻分不清楚?(中)
Easy gene: human tRNA gene loci showed age-related high DNA methylation | research articles
Swift common extension classes and simple encapsulation