Concurrency issues with recursive make and parallel jobs
Problem
When using recursive make, the -j flag only applies to the top‑level invocation; child make processes must inherit the jobserver via $(MAKE) or other mechanisms, otherwise race conditions and instability arise. Developers often need to upgrade gmake 4.4 or set MAKEFLAGS manually, which can cause build errors or reduced performance.
Pain points
- The -j flag's restriction to top-level invocation causes race conditions in child processes
- Manual use of $(MAKE) or MAKEFLAGS to pass the jobserver adds configuration complexity
- Older gmake versions default to pipes instead of FIFO, making concurrency unreliable
- The article "Recursive Make Considered Harmful" highlights a fundamental flaw in recursive make
Questions to verify
- Is recursive make widely used in real projects?
- Are teams willing to upgrade to gmake 4.4 to get the default FIFO behavior?
- Do teams encounter concurrency errors when using -j?
Evidence
quote · @匿名
The `-j` is meant for the top-level invocation only, and the $(MAKE) pattern is standard.The `+` or $(MAKE) "tricks" to ensure the jobserver is inherited in submake and any other subprocess are no longer needed in gmake 4.4 (from 2022) because it defaults to a FIFO instead of pipes. The author should just upgrade gmake :).
quote · @匿名
Setting environment variable `MAKEFLAGS=-j8` transfers to subprocesses.
quote · @匿名
How it works is that the top-level invocation runs the job server, and the children feed requests to it. The top-level controls the parallelism.
quote · @匿名
Don't do it!https://accu.org/journals/overload/14/71/miller_2004/Recursive Make Considered HarmfulBy Peter Miller
Disclaimer: this card is distilled by AI from community discussions as “pain point evidence”. It is a starting point for need analysis and validation, not a “validated market need”. AI has analytical limits; please open the original discussion above to manually verify before key decisions.