Renice: How to change all threads?

renice +/-n -g gid

Where gid is the process group id which you can find with ps -Aj


Inspired by zhihui's answer, what I actually used:

renice -n <niceness> -p `ps --no-heading -Lo tid <PID>`

The following command can set the nice value to +15 for all threads in process "procid":

ps --no-heading -Lj <procid> | awk '{system("renice +15 "$4)}'