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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
14a4a7b5
Commit
14a4a7b5
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
90f70ebd
Changes
3
Show 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 @
14a4a7b5
...
@@ -2342,6 +2342,17 @@ fi
...
@@ -2342,6 +2342,17 @@ fi
fi
fi
#---END:
#---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
# Check if pthread_attr_setscope() exists
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
AC_TRY_LINK(
AC_TRY_LINK(
...
...
storage/innobase/include/ut0ut.h
View file @
14a4a7b5
...
@@ -17,6 +17,19 @@ Created 1/20/1994 Heikki Tuuri
...
@@ -17,6 +17,19 @@ Created 1/20/1994 Heikki Tuuri
typedef
time_t
ib_time_t
;
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,
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++,
but since there seem to be compiler bugs in both gcc and Visual C++,
...
...
storage/innobase/ut/ut0ut.c
View file @
14a4a7b5
...
@@ -336,11 +336,13 @@ ut_delay(
...
@@ -336,11 +336,13 @@ ut_delay(
ulint
delay
)
/* in: delay in microseconds on 100 MHz Pentium */
ulint
delay
)
/* in: delay in microseconds on 100 MHz Pentium */
{
{
ulint
i
,
j
;
ulint
i
,
j
;
volatile
lint
volatile_var
;
j
=
0
;
j
=
0
;
for
(
i
=
0
;
i
<
delay
*
50
;
i
++
)
{
for
(
i
=
0
;
i
<
delay
*
50
;
i
++
)
{
j
+=
i
;
j
+=
i
;
PAUSE_INSTRUCTION
(
&
volatile_var
);
}
}
if
(
ut_always_false
)
{
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