全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Read-modify-write operation, compare-and-swap, acquire and release ordering?

又称: read-modify-write operation · compare-and-swap · acquire ordering · release ordering

Definition 13.10 University Computer Science — Year 3 · 第 13 章 — Concurrency: Deadlock, Monitors and Lock-Free Structures

A read-modify-write operation reads a location and writes it in one atomic operation, as atomic_fetch_add does. Compare-and-swap (CAS) is the read-modify-write that, given a location, an expected value and a new value, writes the new value only if the location holds the expected one, and reports whether it did. A load with acquire ordering keeps every later read and write of its thread after it; a store with release ordering keeps every earlier read and write of its thread before it. A thread whose acquire load reads the value of another thread’s release store sees all the writes that thread made before the store.

在原文中阅读 →