Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Lock-free, wait-free, ABA problem » ?

Aussi appelé : lock-free · wait-free · ABA problem

Definition 13.11 University Computer Science — Year 3 · Chapitre 13 — Concurrency: Deadlock, Monitors and Lock-Free Structures

An implementation of a shared object is lock-free if, whenever threads are running its operations, some operation completes after a finite number of steps of the system, whatever the scheduling. It is wait-free if every operation completes in a finite number of its own thread’s steps. The ABA problem arises when a thread reads a value A, then between its read and its CAS other threads change A to B and back to A: the CAS succeeds when it should not.

The ABA problem in three snapshots. Thread 1’s CAS compares only the head, A, and swings it to the successor it read in snapshot 1. B is now on the stack and in thread 2’s hands at once.
The ABA problem in three snapshots. Thread 1’s CAS compares only the head, A, and swings it to the successor it read in snapshot 1. B is now on the stack and in thread 2’s hands at once.
Lire dans le chapitre →