会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Talk is not cheap, code is free!
Design bug , Fix bug . Something is easy to fix , the others are not !
博客园
首页
新随笔
联系
订阅
管理
2024年2月17日
自旋锁 spinlock VS 互斥锁 mutex
摘要: 使用spinlock的线程会忙等待,不断的检测锁是否可以用,适用条件,锁的内容比较少的时候 使用mutex的线程会引起线程的切换,适用条件,锁的内容比较多的时候 等待的代价小于线程切换的代价的时候可以考虑使用自旋锁,
阅读全文
posted @ 2024-02-17 20:01 wangshaodong
阅读(5)
评论(0)
推荐(0)
编辑
公告