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

Jeffrey Yasskin jyasskin at googlers.com
Mon Oct 14 10:35:56 PDT 2013


On Mon, Oct 14, 2013 at 9:49 AM, Reid Kleckner <rnk at google.com> wrote:
> This seems like way overkill for something that doesn't have a real
> finalizer.

Are you worried about running extra code on shutdown? If so,
ManagedStatic could check is_trivially_destructible in C++11 mode and
avoid registering an atexit callback. +1 to Jim's preference to avoid
doing anything custom if we can avoid it.

> 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.
>
>
> On Mon, Oct 14, 2013 at 9:01 AM, Jim Kearney <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
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list