Critical section
Section titled “Critical section”A critical section is code that accesses shared state under a rule that prevents unsafe concurrent execution.
Mutual exclusion is one common way to protect a critical section. The protected boundary should be large enough to preserve the invariant but no larger than necessary.
The important property is the state transition being protected, not the syntax of the code block.
Used in DKKB
Locks, mutexes, and critical sectionsUse mutual exclusion to serialize access to shared state when concurrent execution would violate an invariant.
Related knowledge
Locks, mutexes, and critical sectionsUse mutual exclusion to serialize access to shared state when concurrent execution would violate an invariant.