Marin Mersenne Famous Monk
Installation Instructions Process Priority
|
Process Priority Linux, Mac OS X, & other Unix-type systems Process priority in Unix-type systems such as Linux and Max OS X is usually given in terms of a process's "nice" value. Nice is an integer associated with each process. The higher a process's nice value (the more nice it is) the lower priority it will have. Lower nice values mean higher priority. In Linux, nice ranges from -20 to 19. Normal niceness (i.e. default priority) is 0. When you look at mprime with the top command, it will say that its niceness is 0. This is slightly misleading since it is only showing the priority of the container process. All of the work being done is done by a separate thread running at the lowest priority available. The current mprime program runs a minimum of 3 threads: the main program thread, one for communicating with the PrimeNet server, and at least one for doing actual calculations. The main thread and the communication thread both run at normal priority (nice vlaue of 0). The worker thread or threads which perform calculations and consequently use a lot of CPU time will run at the lowest possible priority (nice value of 19). You can verify this using the top command. Here are some screenshots illustrating the different thread priorities for the mprime program:
Here is the output from the command top. It does not show the program divided into threads, so it only shows the nice value of the main thread.
Here is the output from the command top -H. This shows the top threads running; you can see two worker threads of mprime, both with a niceness of 19.
Here is the output from the command top -H -p 9441. In this case 9441 was the process ID for the main mprime program. This command shows all of the threads of the process with the ID specified. Notice that the main thread and the communication thread have a niceness of 0, but have spent very little time running. The worker threads, which have spent a lot of time on the CPU, both have a niceness of 19.
|
|