[Bf-blender-cvs] [ef502854feb] master: Threads: add spinlock hit for hyperthreading processors on Windows.
Brecht Van Lommel
noreply at git.blender.org
Sat May 26 22:38:17 CEST 2018
Commit: ef502854feb6b81119954206bff414d4507f4f3c
Author: Brecht Van Lommel
Date: Sat May 26 22:29:10 2018 +0200
Branches: master
https://developer.blender.org/rBef502854feb6b81119954206bff414d4507f4f3c
Threads: add spinlock hit for hyperthreading processors on Windows.
Suggested by Percy Ross Tiglao.
===================================================================
M source/blender/blenlib/intern/threads.c
===================================================================
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 761f3982e28..e6f5d9839ea 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -488,7 +488,8 @@ void BLI_spin_lock(SpinLock *spin)
#elif defined(_MSC_VER)
while (InterlockedExchangeAcquire(spin, 1)) {
while (*spin) {
- /* pass */
+ /* Spinlock hint for processors with hyperthreading. */
+ YieldProcessor();
}
}
#else
More information about the Bf-blender-cvs
mailing list