[pgpool-hackers: 2346] Re: [pgpool-committers: 4036] pgpool: Use volatile pointer for Req_info variable.
m.usama at gmail.com
Thu May 18 21:49:58 JST 2017
On Tue, May 16, 2017 at 4:55 PM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> Watchdog uses shared memory and I wonder if some of pointer variables
> to the shared memory are may need "volatile" to make sure that they
> fetch the fresh value. What do you think?
*ipc_shared_key* and *watchdog_ipc_address* are only set once at the
startup time and never changed So I don't think we need to make it volatile.
But I think we may need watchdog_require_cleanup and
watchdog_node_escalated to be declared as volatile.
> /* shared memory variables */
> char *watchdog_ipc_address = NULL;
> bool *watchdog_require_cleanup = NULL; /* shared memory variable set to
> * when watchdog process terminates abnormally
> bool *watchdog_node_escalated = NULL; /* shared memory variable set to
> * when watchdog process has performed escalation
> unsigned int *ipc_shared_key = NULL; /* key lives in shared memory
> * used to identify the ipc internal
> * clients
> Use volatile pointer for Req_info variable.
> > Since Req_info points to shared memory area, using volatile pointer
> > will allow to fetch the fresh value.
> > Branch
> > ------
> > master
> > Details
> > -------
> > https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=
> > Modified Files
> > --------------
> > src/include/pool.h | 2 +-
> > src/main/pgpool_main.c | 2 +-
> > src/test/regression/tests/010.rewrite_timestamp/timestamp/main.c | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pgpool-hackers