|
|
|
|
|
by onemoreact
5317 days ago
|
|
Don't write to the same location. Everything needs to be a pointer, but updating pointers is an atomic operation. aka assume a is an integer. a->(0x00010001)->5
a->(0x00030001)->6
You can keep reading 0x00010001 and getting 5 all day even as a is "actually' 6. This also works with strings or objects etc, the only downside is you tend to eat up a far amount of memory, and you need to avoid freeing 0x00010001 when something still thinks a's value is stored there. |
|