开发者

Concurrecy: Mutual Exclusion only?

开发者 https://www.devze.com 2023-04-13 10:00 出处:网络
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?

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消