summaryrefslogtreecommitdiff
path: root/include/atomic
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2017-12-07 15:03:59 +0200
committerMonty <monty@mariadb.org>2017-12-08 13:44:45 +0200
commitb3346c2f41d0f7bd0d919826592b37ae09fa41c8 (patch)
treef9bd618332962cf5bbd3207e536d76f3a011e3ad /include/atomic
parent07e9ff1fe18999e1acd640ee3b2169c3f506fb35 (diff)
downloadmariadb-git-b3346c2f41d0f7bd0d919826592b37ae09fa41c8.tar.gz
Restore LF_BACKOFF
Moved InnoDB UT_RELAX_CPU() to server. Restored cross-platform LF_BACKOFF implementation basing on UT_RELAX_CPU().
Diffstat (limited to 'include/atomic')
-rw-r--r--include/atomic/generic-msvc.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/include/atomic/generic-msvc.h b/include/atomic/generic-msvc.h
index 6c5272c98f4..8daa497036f 100644
--- a/include/atomic/generic-msvc.h
+++ b/include/atomic/generic-msvc.h
@@ -90,37 +90,7 @@ C_MODE_END
ret= 0; /* avoid compiler warning */ \
ret= IL_COMP_EXCHG ## S (a, ret, ret);
#endif
-/*
- my_yield_processor (equivalent of x86 PAUSE instruction) should be used
- to improve performance on hyperthreaded CPUs. Intel recommends to use it in
- spin loops also on non-HT machines to reduce power consumption (see e.g
- http://softwarecommunity.intel.com/articles/eng/2004.htm)
-
- Running benchmarks for spinlocks implemented with InterlockedCompareExchange
- and YieldProcessor shows that much better performance is achieved by calling
- YieldProcessor in a loop - that is, yielding longer. On Intel boxes setting
- loop count in the range 200-300 brought best results.
- */
-#ifndef YIELD_LOOPS
-#define YIELD_LOOPS 200
-#endif
-
-static __inline int my_yield_processor()
-{
- int i;
- for(i=0; i<YIELD_LOOPS; i++)
- {
-#if (_MSC_VER <= 1310)
- /* On older compilers YieldProcessor is not available, use inline assembly*/
- __asm { rep nop }
-#else
- YieldProcessor();
-#endif
- }
- return 1;
-}
-#define LF_BACKOFF my_yield_processor()
#else /* cleanup */
#undef IL_EXCHG_ADD32