changes
[model-checker-benchmarks.git] / mpmc-queue / note.txt
1 #1 Why this data structure is non-SC (but it's SC at abstraction).
2
3 The underlying pattern of the non-SCness are as the following:
4
5 T1                              T2
6 x = 1;                  y = 1;
7 r1 = y;                 r2 = x;
8
9 Suppose there are two identical threads, both having a writer followed by a
10 reader, as follows:
11
12 T1                                                      T2
13 m_written.CAS;                          m_rdwr.CAS;
14
15 m_rdwr.CAS;                                     m_written.CAS; // In write_publish()
16
17 m_written.load; // a            m_rdwr.load; // The first in the read_fetch() // b
18
19 a & b can both read old value and it's non-SC. However, the later loads and CAS
20 in the loops will finally fix this problem.