当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
[HarmonyOS] [ARK UI] How to double-click the return key to exit in HarmonyOS ets language
GBJ2510-ASEMI电机专用25A整流桥GBJ2510
Verilog之数码管译码
类和对象—6个默认成员函数
自定义查询--关于倒排索引的研究
MySQL之数据库维护
Swift 常用扩展类和简单封装
The configuration process and related syntax of writing markdown format notes in vscode
【JZ64 求1+2+3+...+n】
Typroa 替代工具marktext
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
电压继电器SRMUVS-100VAC-2H2D
图像去噪——Neighbor2Neighbor: Self-Supervised Denoising from Single Noisy Images
ansible学习笔记01
VLAN实验
idea的package没有空心
HJY-F931A/YJ三相电压继电器
PL5920 SOT-23-6 21V、2A、600KHz同步降压DC/DC转换器
VLAN相关知识点
ABP学习资源整理









