How to change priority of specific thread (LWT) in Linux?

3.4k Views Asked by At

It's possible to see priorities and scheduling policies of all threads of a process like that:

ps H -o 'tid pri cls comm' PID

How to change the individual thread priorities from the command line?

The commands like renice and chrt seem to affect the whole process, but I'm searching the critical path among the threads. Is there maybe anything useful in /proc?

1

There are 1 best solutions below

5
On BEST ANSWER

You can use chrt

Example:

sudo chrt -r -p 40 1502

where 40 is the priority and 1502 is the TID

second column from ps -eLo pid,tid,rtprio,ni,comm output