5. Data Race
-
$ objdump -d t1 > t1.disasm.txt
# (note on %rip addressing)
... a4a: 8b 05 dc 15 20 00 mov 0x2015dc(%rip),%eax # 20202c <counter> a50: 83 c0 01 add $0x1,%eax a53: 89 05 d3 15 20 00 mov %eax,0x2015d3(%rip) # 20202c <counter> ...
Textbook example:mov 0x8049a1c, %eax add $0x1, %eax mov %eax, 0x8049a1c
Need mutual exclusion or atomic operations