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

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?
Date: 2015-10-16 00:07:48
Message-ID: CAEepm=0-FFs06HNmVpbt=UxTUbi=cjSw0X4oKmr9_Rw-zUWO=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 7, 2015 at 8:52 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Oct 1, 2015 at 11:01 PM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
>>> Right, see attached.
>>
>> It seems to me that we could as well simplify checkpoint.c and
>> logical.c. In those files volatile casts are used as well to protect
>> from reordering for spinlock operations. See for example 0002 on top
>> of 0001 that is Thomas' patch.
>
> These patches look good to me, so I have committed them.

Thanks. Also, spin.h's comment contains an out of date warning about
this. Here's a suggested fix for that, and a couple more volatrivia
patches.

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
spin-header-comment.patch application/octet-stream 1.2 KB
strip-volatile-hash.patch application/octet-stream 3.8 KB
strip-volatile-ipc.patch application/octet-stream 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2015-10-16 00:23:49 Re: Parallel Seq Scan
Previous Message Amit Langote 2015-10-16 00:03:49 Re: Fix unclear comments in tablecmds.c