The problem is that every processor has a duplicate of the shared value X in its local cache, and there's no mechanism to tell other processors when one processor is updating the main memory. In this case, the value in main memory is not the "last" value in memory.
emt
To sum up, locks could not have fixed anything because it's not a synchronization issue; it's that the memory needs to know where the most updated value of X is. There's an illusion of a single shared address space, but the computer makes copies of the value in multiple caches. The problem here is that the multiple caches are not communicating with each other, resulting in the program getting inconsistent information.
The problem is that every processor has a duplicate of the shared value X in its local cache, and there's no mechanism to tell other processors when one processor is updating the main memory. In this case, the value in main memory is not the "last" value in memory.
To sum up, locks could not have fixed anything because it's not a synchronization issue; it's that the memory needs to know where the most updated value of X is. There's an illusion of a single shared address space, but the computer makes copies of the value in multiple caches. The problem here is that the multiple caches are not communicating with each other, resulting in the program getting inconsistent information.