本文介绍了执行顺序一致但不是静态一致的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在并发程序的正确性的上下文中,顺序一致性比静态一致性更强的条件根据多核处理器编程的艺术由Maurice Herlihy和Nir Shavit(第3章)
作者还在3.4.1中提到,是顺序一致的执行,不是静态一致的。我不明白怎么样。

解决方案

考虑一个,您将入队和出队元素。



关于并发的 ,我阅读(p.20):

如果假设两个队列之间的队列是静止的,从T1,并且出队应该返回x。如果假设两个入队之间没有静态间隔,那么可以根据需要重新排序两个入队,而deq():y是一致的。


In the context of correctness of concurrent programs, Sequential consistency is stronger condition than quiescent consistency according to The art of multiprocessor programming by Maurice Herlihy and Nir Shavit(chapter 3)Authors also mention in 3.4.1 that there are sequentially consistent executions that are not quiescently consistent. I don't understand how. Could somebody throw a light or provide sample execution ?

解决方案

Consider a queue (FIFO) to which you enqueue and dequeue elements.

From this dissertation about concurrency, I read (p.20):

If you assume that between the two enqueue the queue was quiescent, then T2 should see the changes from T1, and the dequeue should return x. If you assume there was no quiescent interval between the two enqueues, then two enqueues can be reorderd as you wish, and deq():y is consistent.

这篇关于执行顺序一致但不是静态一致的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-30 03:22