% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/affinity.R
\name{pin_workers}
\alias{pin_workers}
\title{Pin shard workers to CPU cores}
\usage{
pin_workers(pool = NULL, strategy = c("spread", "compact"), cores = NULL)
}
\arguments{
\item{pool}{Optional shard_pool. Defaults to current pool.}

\item{strategy}{"spread" assigns worker i -> core i mod ncores. "compact"
assigns workers to the first cores.}

\item{cores}{Optional integer vector of available cores (0-based). If NULL,
uses 0:(detectCores()-1).}
}
\value{
Invisibly, a logical vector per worker indicating success.
}
\description{
Best-effort worker pinning to improve cache locality and reduce cross-core
migration. Currently supported on Linux only.
}
\examples{
\donttest{
affinity_supported()
}
}
