Jump to content

ABA problem

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sutekh.destroyer (talk | contribs) at 23:14, 18 February 2008 (Create page describing basic ABA problem). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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