On 10/10/21 5:21 AM, Stefan Kangas wrote: > Omar Polo writes: >> OpenBSD disables hyperthreading by default so HW_NCPU is (almost) always >> misleading. For example, on my machine >> >> % uname -a >> OpenBSD venera 7.0 GENERIC.MP#221 amd64 >> % sysctl hw.ncpu >> hw.ncpu=8 >> % sysctl hw.ncpuonline >> hw.ncpuonline=4 >> >> and this has been the case for a while already (I mean, a couple of >> years if not more.) > > BTW, Gnulib doesn't seem to make this distinction (lib/nproc.c:313). > Maybe that should be reported to the Gnulib developers? No need for a bug report as I'm one of those developers. To fix the Gnulib nproc OpenBSD issue I installed the first attached patch into Gnulib, and to port Emacs's recently-added processor-count code to more platforms I installed the second attached patch into Emacs's emacs-28 branch. Although I think the latter patch means that emacs/src/w32proc.c's w32-get-nproc function can be removed, I'll let the Emacs MS-Windows experts opine on that.