Jump to content

ABA problem: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Added wiki links
m Made reference into ordered list
Line 8: Line 8:


== References ==
== References ==
* Damian Dechev, Peter Pirkelbauer, and Bjarne Stroustrup. [http://www.research.att.com/~bs/lock-free-vector.pdf Lock-free Dynamically Resizable Arrays]
# Damian Dechev, Peter Pirkelbauer, and Bjarne Stroustrup. [http://www.research.att.com/~bs/lock-free-vector.pdf Lock-free Dynamically Resizable Arrays]


{{Comp-sci-stub}}
{{Comp-sci-stub}}

Revision as of 23:56, 18 February 2008

The ABA problem occurs when multiple threads (or processes) accessing shared memory interleave. Below is the sequence of events that will result in the ABA problem:

  • Process reads value A from shared memory,
  • is preempted, allowing process ,
  • modifies the shared memory value A to value B and back to A before preemption,
  • begins execution again, sees that the shared memory value has not changed and continues.

Although can continue executing, it is possible that the behavior will not be correct due to the "hidden" modification in shared memory.

References

  1. Damian Dechev, Peter Pirkelbauer, and Bjarne Stroustrup. Lock-free Dynamically Resizable Arrays