COMP 409 Lecture Notes - Lecture 13: Branch Table, Partially Ordered Set, Interrupt
Document Summary
X = y = 0 (cid:1379) (cid:1378) r1 = x; do { do { r2 = y; There are two data races, but once the justi cation process is applied and a real happens-before graph is built up from the actual runtime trace, we end up with a well-behaved execution. As such, we get two infinite loops, making the y = 42; and x = 42; useless, and removing the data races. The program is correctly synchronized, but in a subtle way. Last time: java memory model, data race free (cid:314) sequential consistency, not data race free (cid:314) complex process . Example: do { r1 = x; x = y = 0 (cid:1379) (cid:1378) do { r2 = y; This is data race free, because there are no data races in the runtime. } while (r2 == 0); x = 42; Integrate multithreading and memory models issues in c++