> We also implemented a GNU Make Jobserver integration to this mechanism, > as implemented in jobserver.cc. This works as follows: > diff --git a/gcc/jobserver.cc b/gcc/jobserver.cc > new file mode 100644 > index 00000000000..8cb374de86e > --- /dev/null > +++ b/gcc/jobserver.cc
I wonder if this can go in separately and be first used to trottle down the number of streaming processes in WPA? See TODO at the beggining of do_whole_program_analysis and the logic in stream_out_partitions. Adding your API to take tokens for every new partition being streamed (with exception of first one) is probably very easy. Note that there is also logic for detecting jobserv in toplev.c that may be merged with your logic. In longer run I think your jobserv.cc fits more to liberty, but we could have it for GCC only until other tools will want to integreate. Honza