[pgpool-hackers: 2346] Re: [pgpool-committers: 4036] pgpool: Use volatile pointer for Req_info variable.

Muhammad Usama 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:

> Usama,
>
> 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.

Regards
Muhammad Usama

>
> /* shared memory variables */
> char *watchdog_ipc_address = NULL;
> bool *watchdog_require_cleanup = NULL;  /* shared memory variable set to
> true
>
>        * when watchdog process terminates abnormally
>
>        */
> bool *watchdog_node_escalated = NULL;   /* shared memory variable set to
> true
>
>        * 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=
> a4de4bfc1421d787b53789eb62eb7e9cb26e91c1
> >
> > 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
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20170518/491148a8/attachment-0001.html>


More information about the pgpool-hackers mailing list