ABA problem
Multithreading computing anomaly
Multithreading computing anomaly
In multithreaded computing, the ABA problem occurs during synchronization, when a location is read twice, has the same value for both reads, and the read value being the same twice is used to conclude that nothing has happened in the interim; however, another thread can execute between the two reads and change the value, do other work, then change the value back, thus fooling the first thread into thinking nothing has changed even though the second thread did work that violates that assumption. The ABA problem occurs when multiple threads (or processes) accessing shared data interleave. Below is a sequence of events that illustrates the ABA problem: Process P1 reads value A from some shared memory location, P1 is preempted, allowing process P2 to run, P2 writes value B to the shared memory location P2 writes value A to the shared memory location P2 is preempted, allowing process P1 to run, P1 reads value A from the shared memory location, P1 determines that the shared memory value has...
Open boosters, collect cards and trade them. Free to play.
Play for free