InitializeCriticalSectionAndSpinCount,是否有默认的旋转计数?
如果改为调用“正常”InitializeCriticalSection()
,是否设置了“默认”旋转计数? (或者是 0,没有旋转?)
The API method InitializeCriticalSectionAndSpinCount
allows you to set a spin count so when EnterCriticalSection
is called, it loops using a spinlock to try to acquire the resource some number of times. Only if all the attempts fail does the thread transition to kernel mode to enter a wait state.
If the 'normal' InitializeCriticalSection()
is called instead, is there a 'default' spin count set? (Or is it 0, no spin?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引用自此
因此默认值为无旋转。
Quoting from this article:
So the default is no spin.