questions about Peterson lock and atomicity - bridging chapters 2 and 7

148 views
Skip to first unread message

Daniel Sadoc Menasche

unread,
Apr 19, 2018, 1:37:50 PM4/19/18
to art-of-multiproc...@googlegroups.com, masbicudo, Leonardo Neves
Dear all,

in the proofs of chapter 2, it is assumed that reads and writes are atomic, right? Which arguments would break if atomicity is not guaranteed?

In particular, I'm curious about Peterson algorithm for 2 threads: it is mentioned in Section 7.1 that the order of writes of flag[B] and victim is important (validating eq 2.3.9), and also that read-write operations are atomic.  I do not see, however, why this is the case.  Any insights here would be very welcome.

In particular, I'm not being able to find a problem 

1) if the write to flag[B] and victim is inverted

2) if the write to flag[B] and victim is non-atomic

thanks!

best, Daniel




Reply all
Reply to author
Forward
0 new messages