Re: Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?
Date
Msg-id 20150922101549.GD7400@alap3.anarazel.de
Whole thread Raw
In response to Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Hi,

On 2015-09-17 16:32:17 +1200, Thomas Munro wrote:
> In walsender.c, walreceiver.c, walreceiverfuncs.c there are several
> places where volatile qualifiers are used apparently only to prevent
> reordering around spinlock operations.  My understanding is that if
> potential load/store reordering around spinlock operations is the only
> reason for using volatile, 0709b7ee72e4bc71ad07b7120acd117265ab51d0
> made it unnecessary.  For example see
> 6ba4ecbf477e0b25dd7bde1b0c4e07fc2da19348 which stripped some volatile
> qualifiers out of xlog.c.

Same in bufmgr.c et al. There it's actually rather annoying for new code
because volatile needs to be casted away in a bunch of places...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Gavin Flower
Date:
Subject: Re: [COMMITTERS] pgsql: Use gender-neutral language in documentation
Next
From: Geoff Winkless
Date:
Subject: Re: [COMMITTERS] pgsql: Use gender-neutral language in documentation