What Does Taskset Do in Linux?
Contents the Taskset Command Is Used to Set or Retrieve the Cpu Affinity of a Running Process Given Its Pid, or to Launch a New Command with a Given Cpu...
The taskset command is used to set or retrieve the CPU affinity of a running process given its pid, or to launch a new command with a given CPU affinity. CPU affinity is a scheduler property that “bonds” a process to a given set of CPUs on the system.
How to use taskset command?
With the help of the “taskset” command tool, the user can fetch or set the CPU affinity of a particular process with its given process id (PID).
…
Taskset Commands Options:
| Option | Description |
|---|---|
| -a, –all | Used to set the CPU affinity of all tasks for the given PID |
Must Read
What is CPU pinning in Linux?
Processor affinity, or CPU pinning or “cache affinity”, enables the binding and unbinding of a process or a thread to a central processing unit (CPU) or a range of CPUs, so that the process or thread will execute only on the designated CPU or CPUs rather than any CPU.