[PATCH] correct llvm::sys::Memory thread-safety

Jim Kearney jim.kearney at oracle.com
Mon Oct 14 10:18:09 PDT 2013


On 10/14/2013 12:49 PM, Reid Kleckner wrote:
> This seems like way overkill for something that doesn't have a real 
> finalizer.  All threads will observe the same page size, right?  Why 
> not query the size and do an atomic store if the size is 
> uninitialized?  You'd probably need to consult a shared memory expert 
> to get this 100% correct.
>
The actual use of the value is pretty light-weight.  I can rewrite this 
using memory fences easily enough, but is removing one finalization call 
worth the maintenance cost of having a unique implementation?
>
> On Mon, Oct 14, 2013 at 9:01 AM, Jim Kearney <jim.kearney at oracle.com 
> <mailto:jim.kearney at oracle.com>> wrote:
>
>     Please review the attached patch which is intended to fix
>     http://llvm.org/bugs/show_bug.cgi?id=15749. If it's acceptable,
>     please commit it.
>
>     It replaces an auto static with a ManagedStatic<> to eliminate a
>     race in multithreaded code generation (on some platforms/compilers).
>
>     Thanks,
>     J. Kearney
>
>
>     _______________________________________________
>     llvm-commits mailing list
>     llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131014/e4f4afd2/attachment.html>


More information about the llvm-commits mailing list