# Finding the total number of processors on a machine with .NET

DevFeed: [Finding the total number of processors on a machine with .NET](<https://devfeed.tech/articles/finding-the-total-number-of-processors-on-a-machine-with-net-51480.md>)

Original publisher: [Read original article](<https://andrewlock.net/finding-the-total-number-of-processors-on-a-machine-with-dotnet/>)

Author: Andrew Lock

Published: 2026-08-25T10:00:00Z

Content type: tutorial

Language: en

Sources: [Andrew Lock | .NET Escapades](<https://devfeed.tech/sources/andrew-lock-net-escapades.md>)

Topics: [.NET](<https://devfeed.tech/topics/net.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [.NET Framework](<https://devfeed.tech/topics/net-framework.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [net](<https://devfeed.tech/tags/net.md>), [net-core](<https://devfeed.tech/tags/net-core.md>), [net-core-observability](<https://devfeed.tech/tags/net-core-observability.md>), [net-framework](<https://devfeed.tech/tags/net-framework.md>), [observability](<https://devfeed.tech/tags/observability.md>)

## AI overview

This post explains how to retrieve the total number of logical processors on a host machine in .NET, rather than only the processors available to the current process. It compares behavior across .NET Framework and modern .NET, then describes using native APIs on Windows and macOS and parsing files on Linux.

## Source excerpt

In this post I show how to find the total number of logical CPUs on a host (not just those available to a process); something that isn't exposed in modern .NET