I looking for a way to start a real-time process or set a running process as a real-time process.
2 Answers
To start/set a process as real-time, you should use chrt
Usage to start a new process:
chrt priority command [arguments]
Usage to set a running process:
chrt -r -p priority pid
Example:
sudo chrt -r 70 <your command>
or
<your command> & sudo chrt -r 70 $!
Of course, one can do this programmatically just by calling the relevant system calls. There are various commands that wrap these so that one can do also this at the level of shell programming.
- On HP-UX, the command wrapper for this is
rtprio
. - On FreeBSD, the command wrapper for this is
rtprio
with a nod in the manual to the HP-UX tool. - On Illumos, and on Solaris and Ultrix before it, the command wrapper is
priocntl
. - It is
priocntl
on Schillix, too. - In the util-linux toolset for Linux-based operating systems, the command wrapper is
chrt
. - In the BusyBox toolset, the command wrapper is
chrt
with different options available than for the util-linux tool. - In the ToyBox toolset, the command wrapper is
chrt
with a third set of different options.