git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: e80252d) | patch
Change the spinlock primitives to function as compiler barriers.
Tue, 9 Sep 2014 21:45:20 +0000 (17:45 -0400)
Tue, 9 Sep 2014 21:48:50 +0000 (17:48 -0400)
commit 0709b7ee72e4bc71ad07b7120acd117265ab51d0
Change the spinlock primitives to function as compiler barriers.

Previously, they functioned as barriers against CPU reordering but not
compiler reordering, an odd API that required extensive use of volatile
everywhere that spinlocks are used. That's error-prone and has negative
implications for performance, so change it.

In theory, this makes it safe to remove many of the uses of volatile
that we currently have in our code base, but we may find that there are
some bugs in this effort when we do. In the long run, though, this
should make for much more maintainable code.

Patch by me. Review by Andres Freund.
src/backend/storage/lmgr/s_lock.c diff | blob | blame | history
src/include/storage/s_lock.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /