In computer science, read–modify–write is a class of atomic operations (such as test-and-set, fetch-and-add, and compare-and-swap) that both read a memory location and write a new value into it simultaneously, either with a completely new value or some function of the previous value. These operations prevent race conditions in multi-threaded applications. Typically they are used to implement mutexes or semaphores. These atomic operations are also heavily used in non-blocking synchronization.
读-修改-写(read-modify-write)是计算机科学中的一个原子操作(atomic operation,类似的还有test-and-set, fetch-and-add, compare-and-swap等),操作过程是读一个内存位置(或IO端口),修改其值,再写回原位置。 必须要先读操作的一个原因是,系统架构往往只允许字(word)级的读写,必须先读出那些不做修改的位元,保持不变再写回。写成C语言语句类似于: *pRegister |= SOME_BIT; Read-modify-write指令用于IO端口时,可能会产生出乎意料的结果,如无法给一个比特置位。这往往是因为写操作并不影响到读操作的源寄存器。 RAID也使用这一术语描述原子操作的read-modify-write序列。 Such RAID levels include RAID 4, RAID 5 and RAID 6.
Abstract from DBpedia / Wikipedia · CC BY-SA
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).