When I renice
a multithreaded process in Ubuntu 10.04, then view the results in top
, it seems that only the main thread actually gets reniced. All the other threads retain their old nice value. What's the easiest way to renice all threads in a process instead of just the main thread?
Where
gid
is the process group id which you can find withps -Aj
Inspired by zhihui's answer, what I actually used:
The following command can set the nice value to +15 for all threads in process "procid":