Linux command
chrt 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
chrt -p PID
Example
chrt -a -p PID
Example
chrt -m
Example
chrt -p priority PID
Example
chrt --fifo -p priority PID
Example
chrt --rr -p priority PID
Example
chrt --idle 0 command
说明
chrt sets or retrieves the real-time scheduling attributes of an existing process, or runs a command with specified scheduling attributes. It supports various Linux scheduling policies including FIFO, round-robin, batch, idle, and deadline. Real-time scheduling policies (SCHED_FIFO, SCHED_RR) give processes priority over normal tasks, which is critical for time-sensitive applications like audio processing, industrial control, and high-frequency trading. Non-real-time policies (SCHED_BATCH, SCHED_IDLE) are useful for background workloads that should yield to interactive processes. The tool is part of the util-linux package and operates via the sched_setscheduler(2) and sched_setattr(2) system calls.
参数
- -p, --pid
- Operate on an existing PID without launching a new task
- -a, --all-tasks
- Set or retrieve scheduling attributes for all threads of a PID
- -m, --max
- Show minimum and maximum valid priorities for each policy
- -v, --verbose
- Show status information
- -R, --reset-on-fork
- Children do not inherit privileged scheduling policies
- -o, --other
- Set SCHED_OTHER policy (default Linux time-sharing)
- -f, --fifo
- Set SCHED_FIFO policy (first in-first out)
- -r, --rr
- Set SCHED_RR policy (round-robin, default when no policy given)
- -b, --batch
- Set SCHED_BATCH policy for batch processing (priority must be 0)
- -i, --idle
- Set SCHED_IDLE policy for very low priority tasks (priority must be 0)
- -d, --deadline
- Set SCHED_DEADLINE policy for sporadic deadline scheduling (priority must be 0)
FAQ
What is the chrt command used for?
chrt sets or retrieves the real-time scheduling attributes of an existing process, or runs a command with specified scheduling attributes. It supports various Linux scheduling policies including FIFO, round-robin, batch, idle, and deadline. Real-time scheduling policies (SCHED_FIFO, SCHED_RR) give processes priority over normal tasks, which is critical for time-sensitive applications like audio processing, industrial control, and high-frequency trading. Non-real-time policies (SCHED_BATCH, SCHED_IDLE) are useful for background workloads that should yield to interactive processes. The tool is part of the util-linux package and operates via the sched_setscheduler(2) and sched_setattr(2) system calls.
How do I run a basic chrt example?
Run `chrt -p PID` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --pid do in chrt?
Operate on an existing PID without launching a new task