Removing shm_mq.c's volatile qualifiers

Started by Thomas Munroabout 8 years ago4 messageshackers
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

Hi,

As far as I can see, all the volatile qualifiers in shm_mq.c have been
redundant since ec9037df263. Here's a patch to remove them (like
several similar patches -- see commit message). Does this make sense?
Is there something special about that pointer to volatile pointer to
PGPROC? If so I don't see it.

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

Attachments:

0001-Remove-volatile-qualifiers-from-shm_mq.c.patchapplication/octet-stream; name=0001-Remove-volatile-qualifiers-from-shm_mq.c.patchDownload+27-34
#2Robert Haas
robertmhaas@gmail.com
In reply to: Thomas Munro (#1)
Re: Removing shm_mq.c's volatile qualifiers

On Sun, Feb 11, 2018 at 6:52 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:

As far as I can see, all the volatile qualifiers in shm_mq.c have been
redundant since ec9037df263.

That's the commit that added shm_mq.c. ITYM 0709b7ee as you said in
the commit message....

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Thomas Munro
thomas.munro@gmail.com
In reply to: Robert Haas (#2)
Re: Removing shm_mq.c's volatile qualifiers

On Tue, Feb 13, 2018 at 9:09 AM, Robert Haas <robertmhaas@gmail.com> wrote:

On Sun, Feb 11, 2018 at 6:52 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:

As far as I can see, all the volatile qualifiers in shm_mq.c have been
redundant since ec9037df263.

That's the commit that added shm_mq.c. ITYM 0709b7ee as you said in
the commit message....

Right, sorry. They were needed when they were added in ec9037df263
(Jan 2014) but they became redundant in 0709b7ee (Sep 2014).

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

#4Andres Freund
andres@anarazel.de
In reply to: Thomas Munro (#1)
Re: Removing shm_mq.c's volatile qualifiers

Hi,

On 2018-02-12 12:52:32 +1300, Thomas Munro wrote:

From e584628bb846be11a137b5216e955284dfd646a5 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@enterprisedb.com>
Date: Thu, 8 Feb 2018 18:50:32 +1300
Subject: [PATCH] Remove volatile qualifiers from shm_mq.c.

Since commit 0709b7ee, spinlock primitives include a compiler barrier so
it is no longer necessary to access either spinlocks or the memory they
protect through pointer-to-volatile. Like earlier commits e93b6298, d53e3d5f,
430008b5, 8f6bb851, df4077cd.

Pushed.

Thanks,

Andres