Recent

Author Topic: GetCPUCount, GetSystemThreadCount on aarch64  (Read 922 times)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 273
GetCPUCount, GetSystemThreadCount on aarch64
« on: February 22, 2023, 05:11:33 pm »
I noticed that both GetCPUCount and GetSystemThreadCount returns 1 on aarch64.
Is there an alternative to those functions on aarch64?

Lazarus 2.2.5 (rev lazarus_2_2_4-6-gc2eb7446af) FPC 3.2.2 x86_64-darwin-cocoa

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: GetCPUCount, GetSystemThreadCount on aarch64
« Reply #1 on: February 22, 2023, 11:22:13 pm »
On my Mac Studio, "sysctl -a | grep cpu" shows:

Quote
machdep.cpu.cores_per_package: 10
machdep.cpu.core_count: 10
machdep.cpu.logical_per_package: 10
machdep.cpu.thread_count: 10
machdep.cpu.brand_string: Apple M1 Max

So you should be able to use the sysctl interface to get the info you want. For details on how, see my article on the Wiki: Accessing macOS System Information.

apeoperaio

  • Sr. Member
  • ****
  • Posts: 273
Re: GetCPUCount, GetSystemThreadCount on aarch64
« Reply #2 on: February 23, 2023, 10:26:26 am »
Thank you!

 

TinyPortal © 2005-2018