On Tue, 2024-10-29 at 18:54 +0000, Andrew via austin-group-l at The Open Group wrote: > Ideally, yes. > > Not certain that 100% of make environments have that exact command > available (e.g. Command Prompt, PowerShell). > > It's also more efficient to query an OS API than to create a new > process and parse the I/O streams. > > I propose attempting to query first, and apply a default of 4 as a > fallback.
I don't think it's correct for the ISO standard to mandate this, at least not until/unless there's existing behavior to standardize. I'm not willing to support "-j" by itself having this behavior, in GNU Make. Many users of GNU Make combine -j alone, which means something very different than -jN for some integer N, with the -l option to limit the number of parallel jobs by system load rather than some hardcoded number. In theory this is a much better/more reliable way to do it. We could choose some value N to mean "pick a good default"; maybe something like "-j0". I have to say that choosing a correct N value is difficult, and only getting moreso. There are an increasing number of other build tools which are themselves multithreaded, such as linkers etc., that make could invoke, so just choosing "number of cores" can easily be the wrong thing depending on your build and what tools it invokes. > Note that make implementations such as GNU currently interleave the > output streams from different concurrent tasks, making them harder to > read. Recommend striping outputs in dedicated ncurses style bands, > like Docker. GNU Make has supported non-interleaved output since version 4.0 (released in 2013).
