Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
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
Abuhujair Javed
Postgres FD Implementation
Commits
aef5fe7e
Commit
aef5fe7e
authored
Mar 16, 2012
by
Heikki Linnakangas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments explaining why our Itanium spinlock implementation is safe.
parent
4012810a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
src/include/storage/s_lock.h
src/include/storage/s_lock.h
+30
-2
No files found.
src/include/storage/s_lock.h
View file @
aef5fe7e
...
...
@@ -234,7 +234,23 @@ spin_delay(void)
#endif
/* __x86_64__ */
#if defined(__ia64__) || defined(__ia64)
/* Intel Itanium */
#if defined(__ia64__) || defined(__ia64)
/*
* Intel Itanium, gcc or Intel's compiler.
*
* Itanium has weak memory ordering, but we rely on the compiler to enforce
* strict ordering of accesses to volatile data. In particular, while the
* xchg instruction implicitly acts as a memory barrier with 'acquire'
* semantics, we do not have an explicit memory fence instruction in the
* S_UNLOCK macro. We use a regular assignment to clear the spinlock, and
* trust that the compiler marks the generated store instruction with the
* ".rel" opcode.
*
* Testing shows that assumption to hold on gcc, although I could not find
* any explicit statement on that in the gcc manual. In Intel's compiler,
* the -m[no-]serialize-volatile option controls that, and testing shows that
* it is enabled by default.
*/
#define HAS_TEST_AND_SET
typedef
unsigned
int
slock_t
;
...
...
@@ -785,7 +801,19 @@ tas(volatile slock_t *lock)
#if defined(__hpux) && defined(__ia64) && !defined(__GNUC__)
/*
* HP-UX on Itanium, non-gcc compiler
*
* We assume that the compiler enforces strict ordering of loads/stores on
* volatile data (see comments on the gcc-version earlier in this file).
* Note that this assumption does *not* hold if you use the
* +Ovolatile=__unordered option on the HP-UX compiler, so don't do that.
*
* See also Implementing Spinlocks on the Intel Itanium Architecture and
* PA-RISC, by Tor Ekqvist and David Graves, for more information. As of
* this writing, version 1.0 of the manual is available at:
* http://h21007.www2.hp.com/portal/download/files/unprot/itanium/spinlocks.pdf
*/
#define HAS_TEST_AND_SET
typedef
unsigned
int
slock_t
;
...
...
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