C++ Logo


Advanced search

Re: [SG15] Extending p1184 for direct transfer of BMIs

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Sun, 11 Aug 2019 19:20:59 +0000

On Aug 11, 2019, at 10:34 AM, David Blaikie via SG15 <sg15_at_[hidden]<mailto:sg15_at_[hidden]>> wrote:

Given that at least Clang's module binary format is designed for lazy loading - copying this data around rather than being able to share constant memory mapped files between multiple compilations on the same system seems like it would be a loss (or at best "no better" - the compiler would read all the data into memory and then treat it the same as if it'd mapped it off disk).

Same for MSVC.

What sort of filesystem race conditions do you have in mind?

On Sun, Aug 11, 2019 at 8:37 AM Lyberta via SG15 <sg15_at_[hidden]<mailto:sg15_at_[hidden]>> wrote:
Another extension I would like to propose is to use module mapper to
transfer BMIs directly without needing file system.

In p1184 4.2 change the syntax to something like this:

Query from compiler to build system:

IMPORT $module

Reply from build system:

OK PATH $bmipath

Then compiler uses file system as usual.


OK BLOB $bmicontents

Then build system transfers raw bytes of BMI straight into compiler. The
format of $bmicontents could be something simple like unsigned 64 bit
integer holding the size (assuming BMIs larger than 4 GiB) followed by
raw bytes.


ERROR $msg

Next, query from compiler to build system:

EXPORT $module

Reply from build system:


Then compiler does its default behavior which can be set via command
line flags.


OK PATH $bmipath

Then compiler writes the BMI to the given file system path. The response
can be bikeshedded.



Then compiler transfers BMI directly to the build system. The response
can be bikeshedded.

I think this design avoids file system races and can make distributed
builds faster because file system is usually slower than sockets and
keeping data in RAM.

Later we can expand this to a general purpose communication channel and
avoid file system altogether by transferring source files and object
files via sockets.

SG15 mailing list
SG15 mailing list

Received on 2019-08-11 14:23:00