Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1c3442e2
Commit
1c3442e2
authored
Dec 10, 2008
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a PAUSE instruction to the SPIN loop
according to recommendation from Intel.
parent
cad9fe0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
configure.in
configure.in
+11
-0
storage/innobase/include/ut0ut.h
storage/innobase/include/ut0ut.h
+13
-0
storage/innobase/ut/ut0ut.c
storage/innobase/ut/ut0ut.c
+2
-0
No files found.
configure.in
View file @
1c3442e2
...
...
@@ -2342,6 +2342,17 @@ fi
fi
#---END:
#Check for x86 PAUSE instruction
AC_MSG_CHECKING("for x86 PAUSE instruction")
AC_TRY_COMPILE(
[],
[{__asm__ __volatile__ ("pause");}],
x86_pause_exists=yes, x86_pause_exists=no)
if test "$x86_pause_exists" = "yes"
then
AC_DEFINE([HAVE_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
fi
# Check if pthread_attr_setscope() exists
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
AC_TRY_LINK(
...
...
storage/innobase/include/ut0ut.h
View file @
1c3442e2
...
...
@@ -17,6 +17,19 @@ Created 1/20/1994 Heikki Tuuri
typedef
time_t
ib_time_t
;
#ifdef HAVE_PAUSE_INSTRUCTION
#define PAUSE_INSTRUCTION(volatile_var) {__asm__ __volatile__ ("pause");}
#elif
#ifdef UNIV_SYNC_ATOMIC
#define PAUSE_INSTRUCTION(volatile_var) \
{ \
os_compare_and_swap(volatile_var, 0, 1); \
}
#elif
#define PAUSE_INSTRUCTION(volatile_var)
#endif
#endif
/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
...
...
storage/innobase/ut/ut0ut.c
View file @
1c3442e2
...
...
@@ -336,11 +336,13 @@ ut_delay(
ulint
delay
)
/* in: delay in microseconds on 100 MHz Pentium */
{
ulint
i
,
j
;
volatile
lint
volatile_var
;
j
=
0
;
for
(
i
=
0
;
i
<
delay
*
50
;
i
++
)
{
j
+=
i
;
PAUSE_INSTRUCTION
(
&
volatile_var
);
}
if
(
ut_always_false
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment