I have a quick question about the use of the renice(8) command on FreeBSD when working with multi-threaded applications. I've looked through the man pages and the web, but couldn't really find an answer anywhere.
On Linux, renicing a process will not automatically renice all threads spawned by that same process, so you have to get all the TID's and renice them too. For example, on Linux, to renice a process and all of its threads, you'd need to do something like this:
Question: Does using renice(8) on a process on FreeBSD apply the new nice level to all threads of the process as well? This is assuming the process does not change its own thread's nice levels programmatically.
Similarly, when renicing an entire process group, will that alter the nice levels of all threads belonging to all processes in that process group?
Chapter "4.4 Thread Scheduling" in the book "The design and implementation of the FreeBSD operating system" seems to suggest that the process nice level directly affects the behavior of that process' threads (as far as I can understand it), but I wanted to ask to make sure.
Thank you.
On Linux, renicing a process will not automatically renice all threads spawned by that same process, so you have to get all the TID's and renice them too. For example, on Linux, to renice a process and all of its threads, you'd need to do something like this:
$ renice -n 10 -p $(ps --no-heading -Lo tid <PID-goes-here>)
Question: Does using renice(8) on a process on FreeBSD apply the new nice level to all threads of the process as well? This is assuming the process does not change its own thread's nice levels programmatically.
Similarly, when renicing an entire process group, will that alter the nice levels of all threads belonging to all processes in that process group?
Chapter "4.4 Thread Scheduling" in the book "The design and implementation of the FreeBSD operating system" seems to suggest that the process nice level directly affects the behavior of that process' threads (as far as I can understand it), but I wanted to ask to make sure.
Thank you.