<div dir="ltr">Ping.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 1:12 AM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bigcheese, kledzik, atanasyan, shankarke, Jean-Daniel,<br>
<br>
This patch makes File::parse() multi-thread safe. If one thread is running<br>
File::parse(), other threads will block if they try to call the same method.<br>
File::parse() is idempotent, so you can safely call multiple times.<br>
<br>
With this change, we don't have to wait for all worker threads to finish<br>
in Driver::link(). Previously, Driver::link() calls TaskGroup::sync() to<br>
wait for all threads running File::parse(). This was not ideal because<br>
we couldn't start the resolver until we parse all files.<br>
<br>
This patch increase parallelism by making Driver::link() to not wait for<br>
worker threads. The resolver calls parse() to make sure that the file<br>
being read has been parsed, and then uses the file. In this approach,<br>
the resolver can run with the parser threads in parallel.<br>
<br>
(This patch also opens up a possibility to read files from archive files<br>
speculatively. Currently, reading member files from an archive file is<br>
pretty slow because it's serialized, since the resolver is a single-<br>
threaded routine. We could speed this thing up by instantiating member<br>
files that are likely to be needed. As long as a file instantiation and<br>
its parse() method are side-effect free, that operation does not affect<br>
correctness. I don't do that in this patch, but will try in future.)<br>
<br>
<a href="http://reviews.llvm.org/D6994" target="_blank">http://reviews.llvm.org/D6994</a><br>
<br>
Files:<br>
include/lld/Core/File.h<br>
include/lld/Core/LinkingContext.h<br>
include/lld/Core/Resolver.h<br>
lib/Core/File.cpp<br>
lib/Core/Resolver.cpp<br>
lib/Driver/Driver.cpp<br>
lib/ReaderWriter/ELF/ELFFile.h<br>
lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp<br>
<br>
EMAIL PREFERENCES<br>
<a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</blockquote></div><br></div>