SpinLock

E697521

SpinLock is a lightweight synchronization primitive in .NET used to protect shared data by repeatedly checking for lock availability instead of blocking threads.

All labels observed (1)

Label Occurrences
SpinLock canonical 1

How this entity was disambiguated

Statements (49)

Predicate Object
instanceOf .NET synchronization primitive ⓘ
struct ⓘ
value type ⓘ
alternativeTo Monitor ⓘ
Mutex ⓘ
SemaphoreSlim ⓘ
avoids kernel-mode blocking where possible ⓘ
canCause CPU starvation if held too long ⓘ
constructor SpinLock(bool enableThreadOwnerTracking) ⓘ
defaultBehavior thread owner tracking disabled ⓘ
definedInNamespace System.Threading ⓘ
designedFor low-level synchronization ⓘ
protecting shared data ⓘ
documentedIn Microsoft .NET API reference ⓘ
hasMethod Enter ⓘ
Enter(ref bool lockTaken) ⓘ
Exit ⓘ
Exit(bool useMemoryBarrier) ⓘ
TryEnter ⓘ
TryEnter(int millisecondsTimeout, ref bool lockTaken) ⓘ
TryEnter(ref bool lockTaken) ⓘ
hasProperty IsHeld ⓘ
IsHeldByCurrentThread ⓘ
IsThreadOwnerTrackingEnabled ⓘ
incorrectUseCanLeadTo deadlocks ⓘ
high CPU usage ⓘ
livelocks ⓘ
introducedInVersion .NET Framework 4.0 ⓘ
linked to: .NET Framework
languageSupport C# ⓘ
F# ⓘ
VB.NET ⓘ
linked to: Visual Basic .NET
notRecommendedFor code that may block while holding the lock ⓘ
long-running critical sections ⓘ
single-CPU systems ⓘ
notReentrant true ⓘ
optimizedFor low-contention scenarios ⓘ
option thread owner tracking enabled ⓘ
partOf .NET ⓘ
.NET Core ⓘ
.NET Framework ⓘ
recommendedFor very short critical sections ⓘ
requires careful use of lockTaken flag ⓘ
paired Enter and Exit calls ⓘ
supports timeout in TryEnter ⓘ
synchronizationStyle busy-waiting ⓘ
spinning ⓘ
threadSafety struct must not be copied after initialization ⓘ
usedTo coordinate access to shared resources ⓘ
uses memory barriers for correctness ⓘ

How these facts were elicited

Referenced by (1)

Full triples — surface form annotated when it differs from this entity's canonical label.

System.Threading → containsType → SpinLock ⓘ