Double compare-and-swap

Double compare-and-swap

Double Compare And Swap (DCAS or CAS2) is an atomic primitive proposed to support certain concurrent programming techniques. DCAS takes two not necessarily contiguous memory locations and writes new values into them only if they match pre-supplied "expected" values; as such, it is an extension of the much more popular compare-and-swap (CAS) operation.

(Note that DCAS Double Compare and Swap is sometimes confused with the double-width compare-and-swap implemented by instructions such as x86 CMPXCHG16B. The double compare and swap discussed here handles two discontiguous memory locations, typically of pointer size, whereas the double-width compare-and-swap handles two adjacent pointer sized memory locations, e.g. CMPXCHG16B on a machine with 8B pointers, or CMPXCHG8B on a machine with 4B pointers.)

In his doctoral thesis, Greenwald recommended adding DCAS to modern hardware, showing it could be used to create easy-to-apply yet efficient software transactional memory (STM). More recently, however, it has been shown that an STM can be implemented with comparable properties using only CAS.[citation needed]

One of the advantages of DCAS is the ability to implement atomic deques (i.e. doubly linked lists).[1]. However, DCAS is not a silver bullet: implementing lock-free and wait-free algorithms using it is typically just as complex and error-prone as for CAS. As such, it seems unlikely that DCAS will ever be supported natively on any modern platform. Indeed, as of 2006, it is not supported by any widespread CPUs.

Motorola at one point included DCAS in the instruction set for its 68k series[2]; however its relative slowness[3] led to programmer apathy. It is no longer included in the instruction set, but CAS remains popular.

Sun's cancelled Rock processor would have supported DCAS, which they claimed provides algorithmic power[4].

References

  1. ^ [1]
  2. ^ CAS2
  3. ^ Experimental Implementation
  4. ^ (Mark Moir) Sun HPC Watercooler
  • M. Greenwald. "Non-Blocking Synchronization and System Design". Stanford University Technical Report STAN-CS-TR-99-1624 [2].
  • "DCAS is not a silver bullet for nonblocking algorithm design". 16th annual ACM symposium on Parallelism in algorithms and architectures, 2004, pp. 216–224 [3].

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Double Compare And Swap — (DCAS or CAS2) is an atomic primitive proposed to support certain concurrent programming techniques. DCAS takes two memory locations and writes new values into them only if they match pre supplied expected values; as such, it is an extension of… …   Wikipedia

  • Compare-and-swap — In computer science, the compare and swap (CAS) CPU instruction is a special instruction that atomically compares the contents of a memory location to a given value and, only if they are the same, modifies the contents of that memory location to… …   Wikipedia

  • Comparison of cricket and baseball — Cricket and baseball are the best known members of a family of related bat and ball games. While many of their rules, terminology, and strategies are similar, there are many differences some subtle, some major between the two games. Other present …   Wikipedia

  • Business and Industry Review — ▪ 1999 Introduction Overview        Annual Average Rates of Growth of Manufacturing Output, 1980 97, Table Pattern of Output, 1994 97, Table Index Numbers of Production, Employment, and Productivity in Manufacturing Industries, Table (For Annual… …   Universalium

  • Health and Disease — ▪ 2009 Introduction Food and Drug Safety.       In 2008 the contamination of infant formula and related dairy products with melamine in China led to widespread health problems in children, including urinary problems and possible renal tube… …   Universalium

  • School of Oriental and African Studies — The School of Oriental and African Studies Arms of SOAS Motto Knowledge is Power Established 1916 Type Public …   Wikipedia

  • DCAS — may be: Deputy Chief of the Air Staff Derive computer algebra system Double compare and swap Downloadable Conditional Access System Dynamic Computer Algebra System Devon and Cornwall Archery Society Department of Citywide Administrative Services …   Wikipedia

  • CAS2 (disambiguation) — CAS2 is an airport code for Moose Lake (Lodge) Airport.CAS2 may refer to:*Double Compare And Swap, in computers, machine level instruction *CAS Latency, Column Access Strobe , a timing associated with some kinds of computer memory …   Wikipedia

  • ABA problem — In multithreaded computing, the ABA problem occurs during synchronization, when a location is read twice, has the same value for both reads, and value is the same is used to indicate nothing has changed . However, another thread can execute… …   Wikipedia

  • Проблема ABA — В многозадачных вычислениях, проблема ABA возникает при синхронизации, когда ячейка памяти читается дважды, оба раза прочитано одинаковое значение, и признак «значение одинаковое» трактуется как «ничего не менялось». Однако, другой поток может… …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”