Hi cfe-dev,<div><br></div><div>I'm working on a distributed compiler project using clang(see <a href="http://comments.gmane.org/gmane.comp.compilers.clang.devel/8013">here</a> for more information). One issue I am coming across is that the "master" must have the same working directory as the client it is preprocessing for, so that relative paths resolve correctly. My first intuition was to send the output of getcwd on the slave to the master, and use chdir on the master to set the appropriate working directory, before invoking the preprocessor. However, this brings to mind two concerns:</div>
<div><br></div><div>1. The cache in the FileManager might get confused(e.g. it might cache /u/mike/dir1/test/test.c while /u/mike/dir1 is the cwd, and attempt to access /u/mike/dir2/test/test.c while the cwd is /u/mike/dir2).</div>
<div><br></div><div>2. Since setting the cwd would affect the whole process, it would not be possible to preprocess multiple files simultaneously with different threads.</div><div><br></div><div>Are these two concerns valid? If so, how would you recommend resolving them?</div>
<div><br></div><div>Additionally, I have two more questions:</div><div><br></div><div>1. Is the preprocessor threadsafe? Specifically, I want to know if I can invoke multiple, completely disjoint preprocessors on different threads, without negative consequence.</div>
<div><br></div><div>2. Is the FileManager threadsafe? Specifically, I want to know if I can invoke multiple preprocessors using the same FileManager without negative consequence. If not, would you imagine it to be better to have a single preprocessor with a very large cache, or multiple preprocessors running in parallel with separate, disjoint, but smaller caches?</div>
<div><br></div><div>Thanks!</div><div>Mike</div>