当前位置:网站首页>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.
边栏推荐
- 获取1688app上原数据 API
- RY-D1/1 Voltage Relay
- Neural Ordinary Differential Equations
- Performance testing of API Gateway APISIX on Google Cloud T2A and T2D
- High energy output!Tencent's internal MyCat middleware manual, both theoretical and practical
- 神经网络学习笔记4——自动编码器(含稀疏,堆叠)(更新中)
- MySQL之数据库维护
- 物联网技术概论:第6章
- Beyond Stream Processing!The 4th real-time computing Flink challenge is launched, and 490,000 prizes are waiting for you!
- Voltage relay HDY - vac - 1 A / 1-220
猜你喜欢
随机推荐
unity3d C#语言基础(继承)
Detailed explanation of @RequestBody and @ResponseBody
Assembly to implement bubble sort
360闷声干大事获赞无数,数字安全如何保障?还得看企业安全云
定制.NET 6.0的依赖注入
电压继电器SRMUVS-100VAC-2H2D
UE5 GAS Study Notes Postscript 0
数据库事务,JDBC操作和数据类型
Jingdong school recruited written test questions + summary of knowledge points
真正懂经营管理的CIO具备哪些特质
Vim plugin GrepIt
张量篇-初步
Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
Voltage relay h2d SRMUVS - 100 vac - 2
【HMS core】【FAQ】HMS Toolkit Typical Questions Collection 1
208. 实现 Trie (前缀树)
AB测试 总结归纳
PL5920 SOT-23-6 21V、2A、600KHz同步降压DC/DC转换器
正则表达式快速入门笔记
Linux内核设计与实现(十)| 页高速缓存和页回写









