并发:仅互斥?
提供互斥(即通过自旋锁机制)足以确保并发的有效实现吗?或者我们是否还必须显式实现一些同步方法?
总而言之:
提供并发=有效的互斥实现
或者
提供并发=有效的互斥实现+有效的同步实现
?
谢谢。
is providing mutual exclusion (ie. via spinlock mechanism) enough to ensure effective implementation of concurrency? Or do we have to explicitly implement some synchronization method as well?
In sum:
Provision of concurrency = effective mutual exclusion implementation
OR
Provision of concurrency = effective mutual exclusion implementation + effective synchronization implementation
?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
并发包括“互斥和同步”两个概念。
并发是一种状态的表达。
互斥是Concurrecy中一种状态的表现。
互斥是并发中获得同步的一种技术。
Concurrency includes the both concept of "mutual exclusion and sycronization".
Concurrency is the expression of a state.
Mutual exclusion is the expression of a state in Concurrecy.
Mutual exclusion is a technique to acquire sycronization in Concurrecy.
您真正需要的只是互斥和某种机制(尽管出于性能原因,其他事情通常很有帮助),以确保操作无法“移动”跨越互斥障碍。
All you really need (though other things are often helpful for performance reasons) is mutual exclusion and some mechanism to ensure that operations can't 'move' across the mutual exclusion barriers.