pgsql: Remove most volatile qualifiers from xlog.c

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove most volatile qualifiers from xlog.c
Date: 2014-09-22 21:48:21
Message-ID: E1XWBT3-0002OT-Vu@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove most volatile qualifiers from xlog.c

For the reason outlined in df4077cda2e also remove volatile qualifiers
from xlog.c. Some of these uses of volatile have been added after
noticing problems back when spinlocks didn't imply compiler
barriers. So they are a good test - in fact removing the volatiles
breaks when done without the barriers in spinlocks present.

Several uses of volatile remain where they are explicitly used to
access shared memory without locks. These locations are ok with
slightly out of date data, but removing the volatile might lead to the
variables never being reread from memory. These uses could also be
replaced by barriers, but that's a separate change of doubtful value.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6ba4ecbf477e0b25dd7bde1b0c4e07fc2da19348

Modified Files
--------------
src/backend/access/transam/xlog.c | 470 ++++++++++++++-----------------------
1 file changed, 173 insertions(+), 297 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2014-09-23 00:22:51 pgsql: Process withCheckOption exprs in setrefs.c
Previous Message Robert Haas 2014-09-22 20:54:30 pgsql: Remove volatile qualifiers from lwlock.c.