网站首页  情感咨询  情感美文  情感百科  情感生活  学习充电  旧版美文

请输入您要查询的词汇:

 

词汇 Test and set
分类 英语词汇 英语翻译词典
释义

Test and set

中文百科

检查并设置 Test-and-set

(重定向自Test and set)

在计算机科学中,检查并设置(test-and-set-lock, TSL)是一种不可中断的基本(原语)运算。它会写值到某个内存位置并传回其旧值。在多进程可同时访问内存的情况下,如果一个程序正在运行检查并设置,在它运行完成前,其它的程序不可以运行检查并设置。中央处理器可使用可自行实作此指令,或利用其它电子组件如双端口内存(Dual-ported RAM)所提供的检查并设置机制。

以下则展示一种利用检查并设置指令来实现的锁:

当旧值为 0 时,这进程可以得到锁。否则的话,它会一直尝试将 1 写入内存位置,直到旧值为 0。

英语百科

Test-and-set 检查并设置

(重定向自Test and set)

In computer science, the test-and-set instruction is an instruction used to write to a memory location and return its old value as a single atomic (i.e., non-interruptible) operation. Typically, the value 1 is written to the memory location. If multiple processes may access the same memory location, and if a process is currently performing a test-and-set, no other process may begin another test-and-set until the first process is done. CPUs may use test-and-set instructions offered by other electronic components, such as dual-port RAM; CPUs may also offer a test-and-set instruction themselves.

随便看

 

依恋情感网英汉例句词典收录3870147条英语例句词条,基本涵盖了全部常用英语单词的释义及例句,是英语学习的有利工具。

 

Copyright © 2004-2024 Yiyi18.com All Rights Reserved
京ICP备2021023879号 更新时间:2025/8/9 13:30:24