网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 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.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/18 1:11:26