Questions tagged [spinwait]

A spin-wait loop is a technique used in multithreaded applications whereby one thread waits for other threads for protecting a critical section, for barriers, or for other synchronizations.

A spin-wait loop is a technique used in multithreaded applications whereby one thread waits for other threads for protecting a critical section, for barriers, or for other synchronizations.

References

16 questions
-1
votes
1 answer

trying to replace a lock() with a SpinWait.SpinUntil() but it doesnt work

let start with the code; checkedUnlock is an HashSet _hashsetLock is an object lock (_hashsetLock) newMap = checkedUnlock.Add(uniqueId); vs fun in an int SpinWait.SpinUntil(() => Interlocked.CompareExchange(ref fun, 1, 0) == 1); newMap =…
Fredou
  • 19,848
  • 10
  • 58
  • 113
1
2