[cfe-dev] [RFC] Embedding compilation database info in object files.

Manuel Klimek klimek at google.com
Fri Jul 19 01:08:14 PDT 2013


On Fri, Jul 19, 2013 at 9:02 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk
> wrote:

> On 18 Jul 2013, at 13:08, Manuel Klimek <klimek at google.com> wrote:
>
> >> Wouldn't this approach (appending to a compilation database) have
> issues with filesystem contention and/or write atomicity in
> multicore/distributed builds (without involving a "real database" for the
> database storage)?
> >
> > On Unix systems we can handle that via file locks. On windows we'd need
> a windows expert :P
>
> Adding a mutex does not solve the problem of contention, it just
> eliminates races.  It still adds a serialising step to an inherently
> parallel process, and you should ask Amdahl why this is a bad idea.
>

Well, for example, we can spawn a process that writes to the compilation db
in the background from the driver, and if we assume that C++ compilations
are long compared to writing a line of text to a file, we get that:
a) finishing off the build will be independent of finishing writing to the
compilation db, thus, the impact on the build is negligible
b) the compilation db will probably be finished writing before the build
finishes (as each step probably finishes writing to the compilation db
before the step finishes)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130719/227bead7/attachment.html>


More information about the cfe-dev mailing list