<html>#2326: CCTK_VInfo is not thread-safe
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Erik Schnetter</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td></td></tr>
</table>

<p>Comment (by Roland Haas):</p>
<p>This is not only an issue for <code>CCTK_Warn</code> like functions. Right now nothing in Cactus is guaranteed to be thread safe, since even read only access to shared structures such as the list of warning callbacks or the list of Cactus timers would need protections since those structures can change at runtime. </p>
<p>So far it has been the client code’s responsibility to wrap <code>CCTK_VWarn</code> and the like in <code>omp critical</code> sections. This is useful in particular in Fortran code where multiple <code>CCTK_Warn</code> are used to make up a single error message (and that message should show up as one block and not intermixed by other threads).</p>
<p>This specific case of static variables is addressed in #2322 which is up for review. Even without static variables a <code>critical</code> is a good idea b/c of the list of callbacks being traversed (it is dynamic) and there being multiple <code>fprintf</code> calls in this function.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2326/cctk_vinfo-is-not-thread-safe'>https://bitbucket.org/einsteintoolkit/tickets/issues/2326/cctk_vinfo-is-not-thread-safe</a></p>
</html>