On Fri, 2014-09-12 at 17:43 +0200, Pierre Lindenbaum wrote: > when using $(file ) > http://www.gnu.org/software/make/manual/make.html#File-Function . > > If two targets, built in parallel with option -j, both call > > $(file >>log.txt, Building $@) > > is $file thead safe or is it possible to obtain a mixture of both > messages in the file log.txt ?
GNU make is actually not multithreaded. It will invoke subprocesses that run in parallel, but make itself does not use threads. This means that, as long as you are talking about a single make invocation, there is no way that multiple instances of file (or any other make function) will intermingle, and so the content above will never mix. If you use recursive make and two make processes are running at the same time via -j and both use $(file ...) to update the same file, then it's possible you'll get intermixing of content (but, as long as the length of the content is small, it's pretty unlikely due to the way the kernel handles write() system calls). _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
