Double compare-and-swap (DCAS or CAS2) is an atomic primitive proposed to support certain concurrent programming techniques.
In his doctoral thesis, Michael Greenwald recommended adding DCAS to modern hardware, showing it could be used to create easy-to-apply yet efficient software transactional memory (STM).
[2] One of the advantages of DCAS is the ability to implement atomic deques (i.e. doubly linked lists) with relative ease.
[4] An lock-free deque using hazard pointers and requiring only DWCAS rather than full DCAS was proposed by Maged Michael in 2003.
[5] In general however, DCAS is not a silver bullet: implementing lock-free and wait-free algorithms using it can be just as complex and error-prone as for CAS.