<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 16, 2017 at 4:55 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Usama,<br>
<br>
Watchdog uses shared memory and I wonder if some of pointer variables<br>
to the shared memory are may need &quot;volatile&quot; to make sure that they<br>
fetch the fresh value. What do you think?<br></blockquote><div><br></div><i>ipc_shared_key</i> and <i>watchdog_ipc_address</i> are only set once at the startup time and never changed So I don&#39;t think we need to make it volatile.<br>But I think we may need watchdog_require_cleanup and watchdog_node_escalated to be declared as volatile.<br><div><font color="#000000" face="menlo"><span style="font-size:11px"> </span></font> </div><div>Regards</div><div>Muhammad Usama</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
/* shared memory variables */<br>
char *watchdog_ipc_address = NULL;<br>
bool *watchdog_require_cleanup = NULL;  /* shared memory variable set to true<br>
                                                                                 * when watchdog process terminates abnormally<br>
                                                                                 */<br>
bool *watchdog_node_escalated = NULL;   /* shared memory variable set to true<br>
                                                                                 * when watchdog process has performed escalation<br>
                                                                                 */<br>
unsigned int *ipc_shared_key = NULL;   /* key lives in shared memory<br>
                                                                                * used to identify the ipc internal<br>
                                                                                * clients<br>
                                                                                */ </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div><div class="gmail-h5">&gt; Use volatile pointer for Req_info variable.<br>
&gt;<br>
&gt; Since Req_info points to shared memory area, using volatile pointer<br>
&gt; will allow to fetch the fresh value.<br>
&gt;<br>
&gt; Branch<br>
&gt; ------<br>
&gt; master<br>
&gt;<br>
&gt; Details<br>
&gt; -------<br>
&gt; <a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a4de4bfc1421d787b53789eb62eb7e9cb26e91c1" rel="noreferrer" target="_blank">https://git.postgresql.org/<wbr>gitweb?p=pgpool2.git;a=<wbr>commitdiff;h=<wbr>a4de4bfc1421d787b53789eb62eb7e<wbr>9cb26e91c1</a><br>
&gt;<br>
&gt; Modified Files<br>
&gt; --------------<br>
&gt; src/include/pool.h                                               | 2 +-<br>
&gt; src/main/pgpool_main.c                                           | 2 +-<br>
&gt; src/test/regression/tests/010.<wbr>rewrite_timestamp/timestamp/<wbr>main.c | 2 +-<br>
&gt; 3 files changed, 3 insertions(+), 3 deletions(-)<br>
&gt;<br>
</div></div>______________________________<wbr>_________________<br>
pgpool-hackers mailing list<br>
<a href="mailto:pgpool-hackers@pgpool.net">pgpool-hackers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-hackers</a><br>
</blockquote></div><br></div></div>