Index | Thread | Search

From:
Marc Espie <marc.espie.openbsd@gmail.com>
Subject:
Re: make: -j without params
To:
Janne Johansson <icepic.dz@gmail.com>, Christian Weisgerber <naddy@mips.inka.de>, tech@openbsd.org
Date:
Sun, 23 Feb 2025 19:58:02 +0100

Download raw body.

Thread
On Sun, Feb 23, 2025 at 07:52:35PM +0100, Steffen Nurpmeso wrote:
> Janne Johansson wrote in
>  <CAA6-MF_8mqXvRkxMTQ-VYSWVYamLHuor+F2_50jv--fTYTo6xw@mail.gmail.com>:
>  |Den lör 22 feb. 2025 kl 23:01 skrev Christian Weisgerber <naddy@mips.in\
>  |ka.de>:
>  |> Steffen Nurpmeso:
>  |>> However, he also said
>  |>>   Previously I recommended using a special value, such as "-j0", to mean
>  |>>   "best guess".
>  |>
>  |> xz(1):
>  |>   -T threads, --threads=threads
>  |>          Specify the number of worker threads to use.  Setting
>  |>          threads to a special value 0 makes xz use up to as many
>  |>          threads as the processor(s) on the system support.
>  |
>  |That has worked fine for me using xz and other parallel compressors,
>  |would work fine on make too, if it makes the option parsing simpler.
> 
> Yes.  That.
> 
> But to say (again and hope not to bore) that
> 
>   num_online = MAX(1, sysconf(_SC_NPROCESSORS_ONLN))
>   max_workers = sysconf(_SC_THREAD_THREADS_MAX)
>   if(max_workers < 1 || max_workers > INT_MAX / (int)sizeof(pthread_t))
>     max_workers = INT_MAX / sizeof (pthread_t);

I just wanted -j (nothing)
to be a shorthand to "hey give me cpuonline"

if it's complicated I won't pursue it further


(spoilers: I have some ongoing work to manually control #jobs from
outside, which has loads of applications, see my github...)