kaist-cp/cs431

[Question] About the problem of 2022 Fall

Closed this issue · 2 comments

r2 = r3 = 0 and r1 =1 is possible for:
(X = 1; Z =rel 1) || (r1 =acq Z; r2 = Y) || (Y = 1; r3 = X).

I will call each thread as T1, T2 and T3.

For this question, I assume that the answer is False.

But I'm not quite sure, because the message's view for T1 and T2 could be X=[1@t1], Y=[0@0], Z=[1@t1] (Due to Acquire/Release Synchronization)

But I'm not sure that if this message's view also affects T3, T3 can read X = 0 or not. (i.e., T3's view can be X=[0@0], Y=[1@t2]) This view across the release/acquire fence.

What's the intended answer for this question?

First of all, the answer is true.

I'm not sure what you mean by "message's view." Does it mean per-thread view? If so, then as you said, per-thread view for T1 and T2 after finishing execution can be X=[1@t1], Y=[0@0], Z=[1@t1]. But since T3 does not use any acquire fences or acquire load operations, T3 cannot include X=[1@t1] in its per-thread view. As a result, it is allowed for T3 to read X=0.

Oh I see, thank you. I was curious about the release/acquire view can affect other threads without using synchronization.