On Sun, 22 Oct 2017 19:51:14 -0700 l...@gnu.org (Ludovic Courtès) wrote: > Heya, > > Eric Bavier <ericbav...@centurylink.net> skribis: > > > And from NEWS for the 4.2 release: > > > > * The amount of parallelism can be determined by querying MAKEFLAGS, even > > when > > the job server is enabled (previously MAKEFLAGS would always contain only > > "-j", with no number, when job server was enabled). > > Thanks for digging! I didn’t expect such things to ever change. > > > It Would Be Nice if the functionality worked for older versions of make > > that people might have on their systems. > > With the patch I posted, Scheme compilation would always use one thread > per core, which is what it currently does in ‘master’. > > That’s in argument in favor of the lazy in me: it’s an improvement for > people using a reasonably recent system, and it’s not a regression for > the others! :-) > > WDYT?
Indeed. Understood like that, it makes sense. > > > Using the jobserver directly would require quite a bit of work for the > > current patch set, but I wonder if there is another way to determine > > the -jN parameter for make<4.2 that we could use. Maybe simply > > polling the jobserver fds at the start? > > AIUI the job server does not reveal how many jobs are allowed. It > merely grants you an execution token. > > Or did you have something else in mind? The idea (hardely tested) would be to read tokens from the input fd until it blocks, do the scheme compiles with however many tokens were read, then write them back out. Crude, I guess, and probably error prone; compile-all.scm could be invoked when make has job tokens tied up building the daemon source... Anyhow, the current patch works well for me with a recent make. I'm content leaving further improvements to a future hypothetical hacker. :) `~Eric