set_affinity: Set CPU affinity for the current process

View source: R/affinity.R

set_affinityR Documentation

Set CPU affinity for the current process

Description

Intended to be called inside a worker process (e.g., via clusterCall()). On unsupported platforms, returns FALSE.

Usage

set_affinity(cores)

Arguments

cores

Integer vector of 0-based CPU core ids.

Value

A logical scalar; TRUE on success, FALSE if not supported.

Examples

affinity_supported()

shard documentation built on April 3, 2026, 9:08 a.m.