About: Test and test-and-set     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : owl:Thing, within Data Space : el.dbpedia.org associated with source document(s)

In computer science, the test-and-set CPU instruction is used to implement mutual exclusion in multiprocessor environments. Although a correct lock can be implemented with test-and-set, it can lead to resource contention in busy lock (caused by bus locking and cache invalidation when test-and-set operation needs to access memory atomically). To lower the overhead a more elaborate locking protocol test and test-and-set is used. Given a lock: boolean locked := false // shared lock variable Entry protocol is: Exit protocol is: procedure ExitCritical { locked := false}

AttributesValues
rdfs:label
  • Test and test-and-set (en)
rdfs:comment
  • In computer science, the test-and-set CPU instruction is used to implement mutual exclusion in multiprocessor environments. Although a correct lock can be implemented with test-and-set, it can lead to resource contention in busy lock (caused by bus locking and cache invalidation when test-and-set operation needs to access memory atomically). To lower the overhead a more elaborate locking protocol test and test-and-set is used. Given a lock: boolean locked := false // shared lock variable Entry protocol is: Exit protocol is: procedure ExitCritical { locked := false} (en)
sameAs
dbp:wikiPageUsesTemplate
Subject
prov:wasDerivedFrom
Wikipage page ID
page length (characters) of wiki page
Wikipage revision ID
has abstract
  • In computer science, the test-and-set CPU instruction is used to implement mutual exclusion in multiprocessor environments. Although a correct lock can be implemented with test-and-set, it can lead to resource contention in busy lock (caused by bus locking and cache invalidation when test-and-set operation needs to access memory atomically). To lower the overhead a more elaborate locking protocol test and test-and-set is used. Given a lock: boolean locked := false // shared lock variable Entry protocol is: procedure EnterCritical { do { while ( locked == true ) skip // spin until the lock seems free } while ( TestAndSet(locked) == true ) // attempt actual atomic locking using the test-and-set instruction} Exit protocol is: procedure ExitCritical { locked := false} The entry protocol uses normal memory reads to wait for the lock to become free. Test-and-set is only used to try to get the lock when normal memory read says it's free. Thus the expensive atomic memory operations happen less often than in a simple spin around test-and-set. If the programming language used supports short-circuit evaluation, the entry protocol could be implemented as: procedure EnterCritical { while ( locked == true or TestAndSet(locked) == true ) skip // spin until locked } (en)
foaf:isPrimaryTopicOf
is Wikipage redirect of
is Link from a Wikipage to another Wikipage of
Faceted Search & Find service v1.17_git151 as of Feb 20 2025


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3240 as of Nov 11 2024, on Linux (x86_64-ubuntu_focal-linux-gnu), Single-Server Edition (71 GB total memory, 2 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2025 OpenLink Software