dispenso 1.6.0
A library for task parallelism
Loading...
Searching...
No Matches
cpu_set.h File Reference
#include <cstdint>
#include <thread>
#include <vector>
#include <dispenso/platform.h>

Go to the source code of this file.

Classes

struct  dispenso::CacheGroup
 Describes a group of CPUs that share a cache level. More...
 
class  dispenso::CpuSet
 A set of CPU IDs for affinity manipulation and topology queries. More...
 
struct  dispenso::ThreadGroup
 A scheduling group of CPUs for fork-join thread pool assignment. More...
 

Detailed Description

A portable CPU affinity and NUMA topology facility.

Provides CPU set manipulation, thread-to-core binding, and NUMA/cache topology detection. The primary use case is cache-aware thread group assignment for fork-join scheduling.

Platform support:

  • Linux: Full support (binding via pthread_setaffinity_np, topology via sysfs)
  • FreeBSD: Binding supported (cpuset_setaffinity), topology detection deferred
  • macOS: Topology query only (binding is not supported by the OS)
  • Windows: Full support (binding via SetThreadGroupAffinity, topology via GetLogicalProcessorInformationEx)
See also
docs/design/three_tier_scheduling.md for the design context.

Definition in file cpu_set.h.