Exercise 33

837 views
Skip to first unread message

Unmesh Joshi

unread,
Oct 12, 2013, 6:58:21 PM10/12/13
to art-of-multiproc...@googlegroups.com
Please find the flaw in following explanation:                 
33. Prove that sequential consistency is nonblocking!

I think otherwise. Counter-example is following:

A: ------enq(x)------------------deq(x)---------------->

B:--------enq(y)-------------------deq(y)-------------->

Possible sequential consistent reordering is

    OP1     ->      OP2      ->     OP3       ->      OP4
[enq(x), A] -> [<enq(y), B>] -> [<deq(x), B>] -> [<deq(y), A>]

Now if thread B is delayed in either of the operations OP2 or OP3,
then thread A would not make any progress. (thread A is blocked)

Therefore this sequentially consisteny schedule is NOT non-blocking.
Hence, sequential consistency is  NOT non-blocking.

Unmesh Joshi

unread,
Oct 14, 2013, 12:01:13 PM10/14/13
to art-of-multiproc...@googlegroups.com
[Edit]
Changed the execution


On Sunday, October 13, 2013 12:58:21 AM UTC+2, Unmesh Joshi wrote:
Please find the flaw in following explanation:                 
33. Prove that sequential consistency is nonblocking!

I think otherwise. Counter-example is following:

A: ------enq(x)------------------deq(y)---------------->

B:--------enq(y)-------------------deq(x)-------------->


Possible sequential consistent reordering is

    OP1     ->      OP2      ->     OP3       ->      OP4
[enq(x), A] -> [<enq(y), B>] -> [<deq(x), B>] -> [<deq(y), A>]

Now if thread B is delayed in OP2

SHEKHAR BHANDAKKAR

unread,
Sep 20, 2016, 11:59:08 AM9/20/16
to Art of Multiprocessor Programming
Hello,

Method calls by different threads are unrelated by program order.
So, we can reorder the method calls by different threads. 
This explains the non-blocking property of SC.

In your question we can reorder as:

A: -----------enq(x)------------------deq(x)-------------->
B: ---------------------enq(y)------------------deq(y)---->
Reply all
Reply to author
Forward
0 new messages