[Bf-blender-cvs] [2b21ce73e93] gsoc-2018-many-light-sampling: Threads: add spinlock hit for hyperthreading processors on Windows.
Brecht Van Lommel
noreply at git.blender.org
Fri Jun 1 16:17:48 CEST 2018
Commit: 2b21ce73e9339a71b2b7edd98c823cba99388a14
Author: Brecht Van Lommel
Date: Sat May 26 22:29:10 2018 +0200
Branches: gsoc-2018-many-light-sampling
https://developer.blender.org/rB2b21ce73e9339a71b2b7edd98c823cba99388a14
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