[PATCH] [Core] Update references in parallel
chisophugis at gmail.com
Tue Mar 17 13:58:37 PDT 2015
Comment at: lib/Core/Resolver.cpp:355
@@ -353,3 +354,3 @@
> ruiu wrote:
> > I think this change is not thread-safe because of this line. _deadAtoms.insert is not thread-safe.
> Oh this is really a bummer, considering it's such an hot codepath :(
> Do you think it makes sense to surround insert with a lock and measure again and/or do you have a proposal for an alternative?
Another solution would be to accumulate a separate vector in each thread, then merge them at the end. The `const_cast<Reference *>(ref)->setTarget(newTarget);` also needs some scrutiny. I would suggest testing these parallelism changes with threadsanitizer.
More information about the llvm-commits