简体   繁体   中英

example of a program order which is quiescently consistent but sequentially inconsistent?

The author mentions in the book The art of multiprocessor programming by Maurice Herlihy and Nir Shavit(chapter 3) that sequential consistency and quiescent consistency are unrelated,and there are examples of program orders which are one but not the other. Is there an example of a program order which is quiescently consistent but sequentially inconsistent ?

I'm also reading the book, and I'll try to explain my understanding of this problem. I still don't have the whole picture in my head so there is a chance that I got something wrong :)

Anyway, take a look at Figure 3.8 from the book. The example shows that composition is not sequentially consistent. If you understand the example, you have a sequentially inconsistent execution.

This example as-is is not quiescently consistent. Let's try to change it make it quiescently consistent, but still sequentially inconsistent. All we need to do is to prolong the method calls of thread B to overlap with the calls from thread A. For example q.enq(y) in thread B should overlap with p.enq(x) and q.enq(x) , p.enq(y) in thread B should overlap with q.enq(x) and p.deq(y) and q.deq(x) in thread B should overlap with p.deq(y) .

Now, the same argument is valid: this system is not sequentially consistent. However, the system is quiescently consistent because everything overlaps and therefore there are no restrictions on the order of events.

So we found an execution that is quiescently consistent but not sequentially.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM