Index | Thread | Search

From:
Steffen Nurpmeso <steffen@sdaoden.eu>
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 20:20:36 +0100

Download raw body.

Thread
Marc Espie wrote in
 <Z7tvunYvklRm4pSF@nausicaa.home>:
 |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

The above is from plzip.
I personally hate optional arguments, never supported them myself,
had bad times with sccs where that is needed, and sed's -i i had
to hammer like a white woman singing "banging in the nails" (aka
Tiger Lillies song)

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

I mean sysconf(_SC_NPROCESSORS_AVAIL) or something, you know?
*That* is not easy, let alone portably; see GNU make's
lib/getloadavg.c, for example, complicated and expensive and error
prone, and used on a billion boxes.

 --End of <Z7tvunYvklRm4pSF@nausicaa.home>

'Think i'll switch from Laurent Garnier's Sonar from 2018 to Klaus
Schulze's and Lisa Gerrard's Rheingold appearance, now that i have
seen miod@s background in your github repo; he is also a dead can
dance fan, if i recall correctly.  Much better.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
|
|In Fall and Winter, feel "The Dropbear Bard"s pint(er).
|
|The banded bear
|without a care,
|Banged on himself for e'er and e'er
|
|Farewell, dear collar bear