Saúde
Test-and-set
Texto da Wikipédia (en), licença CC BY-SA. O BETARUBI mostra o verbete inteiro nesta página — a leitura não continua fora do site.
In computer science, the test-and-set instruction is an instruction used to write (set) a flag value to a memory location and return its old value as a single atomic operation. The caller can then "test" the result to see if the state was changed by the call. 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's test-and-set is finished. A central processing unit (CPU) may use a test-and-set instruction offered by another electronic component, such as dual-port RAM; a CPU itself may also offer a test-and-set instruction.
