递归锁
是否有递归锁的用例?是否存在绝对需要递归锁的场景。
使用起来似乎很复杂且危险。我可以看到我们可以避免死锁(只要锁堆栈不溢出),但我们不想捕获这样的问题吗?
也许我在这里遗漏了一些东西。任何指示表示赞赏。
提前致谢。
Is there a use case for recursive locks? Is there a scenario that absolutely requires recursive locking.
Seems to be complicated and dangerous to use. I can see that we may avoid deadlocks (provided the lock stack doesn't overflow) but don't we want to catch such problems.
Maybe I'm missing something here. Any pointers are appreciated.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我喜欢这个博客条目的标题:
递归锁会杀了你
我也喜欢这句话:
最后,这是一篇非常有趣的文章,介绍了递归锁最初是如何进入 Posix pthread 的:
I like the title of this Blog entry:
Recursive locks will kill you
I also like this quote:
Finally, here's an extremely interesting article about how recursive locks got into Posix pthreads in the first place: