Return to Snippet

Revision: 17954
at September 17, 2009 15:38 by deepsoul

Initial Code
# Bit mask of all CPUs: (affinity mask of init process)
taskset -p 1

# CPUs allowed for this shell:
taskset -p $$

# Start job with given CPU mask:
taskset mask command

# Get / Set CPU mask of running command:
taskset -p `pidof command`

taskset -p newmask `pidof command`

Initial URL

Initial Description
Start jobs bound to certain CPU(s), or find the number of available CPUs.

Initial Title
Get / set CPU affinity (Linux)

Initial Tags

Initial Language