<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/23 Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank" class="cremed">rnk@google.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">"slightly?"  More like hugely.  ;)</div></blockquote><div><br></div><div>This shouldn't affect the fast path that much to say "hugely" :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><br></div><div>However, local statics are not thread safe with MSVC yet.  You may want to use something like InitOnceExecuteOnce: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms683493(v=vs.85).aspx" target="_blank" class="cremed">http://msdn.microsoft.com/en-us/library/windows/desktop/ms683493(v=vs.85).aspx</a></div>

</div></blockquote><div><br></div><div>Yeah, I'm aware of this.</div><div>If we had sequential consistency and no HW or SW optimizations, in the worst case we'd get an extra function call and write the same value the second time [or third etc].</div>

<div>I *think* GetProcAddress() also implies some kind of barrier that'd make the race more "benign".</div><div><br></div><div>Not sure if we really want to put an effort to achieve a higher level of confidence now?</div>

</div><br></div></div>