An Entity of Type: programming language, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org

In computer science, compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization. It compares the contents of a memory location with a given value and, only if they are the same, modifies the contents of that memory location to a new given value. This is done as a single atomic operation. The atomicity guarantees that the new value is calculated based on up-to-date information; if the value had been updated by another thread in the meantime, the write would fail. The result of the operation must indicate whether it performed the substitution; this can be done either with a simple boolean response (this variant is often called compare-and-set), or by returning the value read from the memory location (not the value written to it).

Property Value
dbo:abstract
  • Compare-and-Swap (CAS, englisch für Vergleichen und Tauschen) ist eine atomare Operation in der Informatik, um Locking- und Synchronisationsoperationen zu implementieren. Eine Speicherstelle wird mit einem vorgegebenen Wert verglichen, und bei Übereinstimmung mit einem neuen Wert überschrieben. Am Rückgabewert muss abzulesen sein, ob der Tausch ausgeführt wurde. Die CAS-Instruktion ist eine atomare Operation der CPU, d. h. ihr Ablauf kann und darf von keiner anderen Operation unterbrochen werden. Auf Intel-x86- und -Itanium-Prozessoren ist dies die CMPXCHG-Instruktion. Andere atomare CPU-Instruktionen, die in ähnlicher Weise verwendet werden können, sind z. B. und fetch-and-add. Auf RISC-Architekturen ist diese Operation meist als Load-Link/Store-Conditional (LL/SC) implementiert, da die RISC-Philosophie kombinierte read-modify-write Befehle nicht erlaubt. LL/SC hat auch eine etwas enger gefasste Semantik, da es auch nicht-verändernde Zugriffe auf die referenzierte Speicherstelle erkennen kann. (de)
  • In computer science, compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization. It compares the contents of a memory location with a given value and, only if they are the same, modifies the contents of that memory location to a new given value. This is done as a single atomic operation. The atomicity guarantees that the new value is calculated based on up-to-date information; if the value had been updated by another thread in the meantime, the write would fail. The result of the operation must indicate whether it performed the substitution; this can be done either with a simple boolean response (this variant is often called compare-and-set), or by returning the value read from the memory location (not the value written to it). (en)
  • Comparar e intercambiar, también conocido por las siglas CAS (del inglés Compare And Swap), es una operación atómica usada en el diseño de algoritmos concurrentes para permitir la sincronización de hilos de ejecución sin recurrir a bloqueos de los mismos.​ (es)
  • Compare-and-swap (CAS) est une instruction atomique utilisée dans les systèmes multiprocesseurs ou multi-cœurs utilisant une mémoire partagée. Elle compare la valeur stockée à une adresse mémoire donnée à l'un de ses arguments et, en cas d'égalité, écrit une nouvelle valeur à cette adresse. Selon les implémentations, elle signale si l'écriture a réussi soit en renvoyant une valeur booléenne, soit en renvoyant la valeur lue en mémoire. L'instruction CAS simple ne présente presque aucun problème au niveau de la synchronisation de l'adresse mémoire auquel elle pointe, sauf dans un cas précis décrit comme le (en). (fr)
  • コンペア・アンド・スワップ(Compare-and-Swap、CAS)は、CPUの特別な命令の一種。不可分操作として、あるメモリ位置の内容と指定された値を比較し、等しければそのメモリ位置に別の指定された値を格納する。この操作の結果、置換が行われたかどうかを示す必要があり、単純な真理値を返すか、そのメモリ位置から読み込んだ内容(書き込んだ内容ではない)を返す。 CAS命令は、マルチプロセッサシステムでセマフォなどを実装するのに使われる。マルチプロセッサシステムでLock-freeとWait-freeアルゴリズムを実装するのにも使われる。 Maurice Herlihy (1993年) は、CAS命令が単なるリード、ライトやテスト・アンド・セットでは実装できないことを示した。 (ja)
  • Compare-and-swap, CAS (porównaj i zamień) – operacja atomowa stosowana w wielowątkowych procesach w celu synchronizacji. Jej działanie polega na porównaniu zawartości pewnej lokacji w pamięci z zadaną wartością a następnie, jeśli obie wartości są równe, jej zmodyfikowaniu do nowej wartości. Niepodzielność operacji zapewnia, że nowa wartość jest wyznaczona na podstawie aktualnych danych. Jeśli wartość zostałaby w międzyczasie zmodyfikowana przez inny wątek to zapis by się nie powiódł. Wynik operacji musi wskazywać, czy działanie zapisu zostało wykonane czy nie. Może to być prosty typ logiczny lub zwracanie wartości odczytanej z podanej lokacji (lecz nie zapisanej). (pl)
  • I datavetenskapen är compare-and-swap (ungefär: jämför-och-byt ut, ofta förkortat CAS) en CAS(M, V, N) som används i program med flera parallella processer eller trådar för att uppnå synkronisering. Operationen jämför värdet i en minnescell med adressen M med ett givet värde V. Endast om värdet i minnescellen är samma som V ändras värdet i minnescellen till det givna nya värdet N. De ovanstående stegen utförs som en enda atomär operation; andra trådar garanteras inte kunna uppdatera minnescellen M. Operationen måste slutligen rapportera huruvida det önskade värdet verkligen blev uppdaterat i minnescellen. Detta kan göras antingen med en boolesk variabel (denna variant kallas ofta compare-and-set), eller genom att återvända det värdet som fanns i M innan operationen påbörjades (inte värdet N som eventuellt lagrades i M). (sv)
  • Сравнение с обменом (англ. compare and set, compare and swap, CAS) — атомарная инструкция, сравнивающая значение в памяти с одним из аргументов, и в случае успеха записывающая второй аргумент в память. Поддерживается в семействах процессоров x86, Itanium, Sparc и других. (ru)
  • 比较并交换(compare and swap, CAS),是原子操作的一种,可用于在多线程编程中实现不被打断的数据交换操作,从而避免多线程同时改写某一数据时由于执行顺序不确定性以及中断的不可预知性产生的数据不一致问题。该操作通过将内存中的值与指定数据进行比较,当数值一样时将内存中的数据替换为新的值。 (zh)
  • Інструкція compare-and-swap (CAS) використовується в інформатиці як атомарна (тобто безперервна) операція для такої послідовності дій: порівняння значення у пам'яті із заданим значенням і якщо вони рівні, то запис у пам'ять нового значення. Ця інструкція може використовуватись для реалізації таких примітивів синхронізації, як семафор та м'ютекс, а також для алгоритмів без блокувань. CAS еквівалентна , в тому сенсі, що існує алгоритм без блокувань з фіксованою кількістю викликів однієї з них, що реалізує функціональність іншої. Зазвичай, алгоритми, що використовують CAS, зчитують старе значення і на його основі обчислюють нове, а потім використовують CAS для збереження нового значення. Якщо операція CAS завершується невдачею (оскільки зчитане значення вже устаріло), тоді потрібно почати все спочатку. Операція CAS може застосовуватись для реалізації . (uk)
dbo:wikiPageExternalLink
dbo:wikiPageID
  • 632224 (xsd:integer)
dbo:wikiPageLength
  • 18979 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1112416168 (xsd:integer)
dbo:wikiPageWikiLink
dbp:date
  • April 2009 (en)
dbp:reason
  • how large is large? (en)
dbp:wikiPageUsesTemplate
dcterms:subject
gold:hypernym
rdf:type
rdfs:comment
  • In computer science, compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization. It compares the contents of a memory location with a given value and, only if they are the same, modifies the contents of that memory location to a new given value. This is done as a single atomic operation. The atomicity guarantees that the new value is calculated based on up-to-date information; if the value had been updated by another thread in the meantime, the write would fail. The result of the operation must indicate whether it performed the substitution; this can be done either with a simple boolean response (this variant is often called compare-and-set), or by returning the value read from the memory location (not the value written to it). (en)
  • Comparar e intercambiar, también conocido por las siglas CAS (del inglés Compare And Swap), es una operación atómica usada en el diseño de algoritmos concurrentes para permitir la sincronización de hilos de ejecución sin recurrir a bloqueos de los mismos.​ (es)
  • コンペア・アンド・スワップ(Compare-and-Swap、CAS)は、CPUの特別な命令の一種。不可分操作として、あるメモリ位置の内容と指定された値を比較し、等しければそのメモリ位置に別の指定された値を格納する。この操作の結果、置換が行われたかどうかを示す必要があり、単純な真理値を返すか、そのメモリ位置から読み込んだ内容(書き込んだ内容ではない)を返す。 CAS命令は、マルチプロセッサシステムでセマフォなどを実装するのに使われる。マルチプロセッサシステムでLock-freeとWait-freeアルゴリズムを実装するのにも使われる。 Maurice Herlihy (1993年) は、CAS命令が単なるリード、ライトやテスト・アンド・セットでは実装できないことを示した。 (ja)
  • Compare-and-swap, CAS (porównaj i zamień) – operacja atomowa stosowana w wielowątkowych procesach w celu synchronizacji. Jej działanie polega na porównaniu zawartości pewnej lokacji w pamięci z zadaną wartością a następnie, jeśli obie wartości są równe, jej zmodyfikowaniu do nowej wartości. Niepodzielność operacji zapewnia, że nowa wartość jest wyznaczona na podstawie aktualnych danych. Jeśli wartość zostałaby w międzyczasie zmodyfikowana przez inny wątek to zapis by się nie powiódł. Wynik operacji musi wskazywać, czy działanie zapisu zostało wykonane czy nie. Może to być prosty typ logiczny lub zwracanie wartości odczytanej z podanej lokacji (lecz nie zapisanej). (pl)
  • Сравнение с обменом (англ. compare and set, compare and swap, CAS) — атомарная инструкция, сравнивающая значение в памяти с одним из аргументов, и в случае успеха записывающая второй аргумент в память. Поддерживается в семействах процессоров x86, Itanium, Sparc и других. (ru)
  • 比较并交换(compare and swap, CAS),是原子操作的一种,可用于在多线程编程中实现不被打断的数据交换操作,从而避免多线程同时改写某一数据时由于执行顺序不确定性以及中断的不可预知性产生的数据不一致问题。该操作通过将内存中的值与指定数据进行比较,当数值一样时将内存中的数据替换为新的值。 (zh)
  • Compare-and-Swap (CAS, englisch für Vergleichen und Tauschen) ist eine atomare Operation in der Informatik, um Locking- und Synchronisationsoperationen zu implementieren. Eine Speicherstelle wird mit einem vorgegebenen Wert verglichen, und bei Übereinstimmung mit einem neuen Wert überschrieben. Am Rückgabewert muss abzulesen sein, ob der Tausch ausgeführt wurde. Die CAS-Instruktion ist eine atomare Operation der CPU, d. h. ihr Ablauf kann und darf von keiner anderen Operation unterbrochen werden. Auf Intel-x86- und -Itanium-Prozessoren ist dies die CMPXCHG-Instruktion. (de)
  • Compare-and-swap (CAS) est une instruction atomique utilisée dans les systèmes multiprocesseurs ou multi-cœurs utilisant une mémoire partagée. Elle compare la valeur stockée à une adresse mémoire donnée à l'un de ses arguments et, en cas d'égalité, écrit une nouvelle valeur à cette adresse. Selon les implémentations, elle signale si l'écriture a réussi soit en renvoyant une valeur booléenne, soit en renvoyant la valeur lue en mémoire. (fr)
  • I datavetenskapen är compare-and-swap (ungefär: jämför-och-byt ut, ofta förkortat CAS) en CAS(M, V, N) som används i program med flera parallella processer eller trådar för att uppnå synkronisering. Operationen jämför värdet i en minnescell med adressen M med ett givet värde V. Endast om värdet i minnescellen är samma som V ändras värdet i minnescellen till det givna nya värdet N. De ovanstående stegen utförs som en enda atomär operation; andra trådar garanteras inte kunna uppdatera minnescellen M. Operationen måste slutligen rapportera huruvida det önskade värdet verkligen blev uppdaterat i minnescellen. Detta kan göras antingen med en boolesk variabel (denna variant kallas ofta compare-and-set), eller genom att återvända det värdet som fanns i M innan operationen påbörjades (inte värdet (sv)
  • Інструкція compare-and-swap (CAS) використовується в інформатиці як атомарна (тобто безперервна) операція для такої послідовності дій: порівняння значення у пам'яті із заданим значенням і якщо вони рівні, то запис у пам'ять нового значення. Ця інструкція може використовуватись для реалізації таких примітивів синхронізації, як семафор та м'ютекс, а також для алгоритмів без блокувань. CAS еквівалентна , в тому сенсі, що існує алгоритм без блокувань з фіксованою кількістю викликів однієї з них, що реалізує функціональність іншої. Операція CAS може застосовуватись для реалізації . (uk)
rdfs:label
  • Compare-and-swap (de)
  • Comparar e intercambiar (es)
  • Compare-and-swap (en)
  • Compare-and-swap (fr)
  • コンペア・アンド・スワップ (ja)
  • Compare-and-swap (pl)
  • Сравнение с обменом (ru)
  • Compare-and-swap (sv)
  • Compare-and-swap (uk)
  • 比较并交换 (zh)
owl:sameAs
prov:wasDerivedFrom
foaf:isPrimaryTopicOf
is dbo:wikiPageDisambiguates of
is dbo:wikiPageRedirects of
is dbo:wikiPageWikiLink of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License