bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] support for accessing CPU/core count (processor-count)


From: Paul Eggert
Subject: Re: [PATCH] support for accessing CPU/core count (processor-count)
Date: Sun, 10 Oct 2021 14:11:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/10/21 5:21 AM, Stefan Kangas wrote:
Omar Polo <op@omarpolo.com> 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.

Attachment: 0001-nproc-port-better-to-OpenBSD.patch
Description: Text Data

Attachment: 0001-New-function-num-processors.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]