Re: Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?
Date: 2015-09-22 10:15:49
Message-ID: 20150922101549.GD7400@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Geoff Winkless 2015-09-22 10:17:54 Re: [HACKERS] pgsql: Use gender-neutral language in documentation
Previous Message Gavin Flower 2015-09-22 09:52:23 Re: [COMMITTERS] pgsql: Use gender-neutral language in documentation