Is a method with no linearization points always not linearizable?

后端 未结 3 600
时光说笑
时光说笑 2021-02-11 03:08

If you can definitely prove that a method has no linearization points, does it necessarily mean that that method is not linearizable? Also, as a sub question, how can you prove

3条回答
  •  悲&欢浪女
    2021-02-11 03:51

    This answer is based on me reading about linearizability on wikipedia for the first time, and trying to map it to my existing understanding of memory consistency through happens-before relationships. So I may be misunderstanding the concept.

    If you can definitely prove that a method has no linearization points, does it necessarily mean that that method is not linearizable?

    It is possible to have a scenario where shared, mutable state is concurrently operated on by multiple threads without any synchronization or visibility aids, and still maintain all invariants without risk of corruption.

    However, those cases are very rare.

    how can you prove that a method has no linearizatioon points?

    As I understand linearization points, and I may be wrong here, they are where happens-before relationships are established between threads. If a method (recursively through every method it calls in turn) establishes no such relationships, then I would assert that it has no linearizatioon points.

提交回复
热议问题