<div dir="ltr">On Fri, Jul 19, 2013 at 2:08 AM, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank" class="cremed">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 19 Jul 2013, at 10:01, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="cremed">chandlerc@google.com</a>> wrote:<br>
<br>
> There is no need to have it be a separate process at all. Just start a background thread and join it before terminating.<br>
<br>
</div>Have you benchmarked the difference between clang with and without pthreads linked in? A lot of libc and STL things become more expensive (including malloc(), although not by much) when pthreads are linked, even if they're not used.</blockquote>
<div><br></div><div>Yes, I have, and on my systems none of these things are true. I don't know whether or why they are true for you, but I don't think it should guide the decision of how to architect the Clang driver.</div>
<div><br></div><div>In the not too distant future we will almost certainly want to build Clang as a multithreaded binary (if possible to do so) so that we can take advantage of threads internally.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
These may be dwarfed by the CPU time of the compilation, but it isn't free.<br></blockquote><div><br></div><div>Sure, it isn't free. I'm not suggesting that it is. But I am suggesting that it is a totally viable fallback strategy for this use case, and that the cost is negligible while still being non-zero.</div>
</div></div></div>