“不错"吗?影响Java线程的优先级 [英] Does "nice" affect the priority of Java threads
问题描述
在Unix系统上,可以使用nice
命令以较低的CPU优先级运行进程:
On a Unix system, you can run a process at lower CPU priority using the nice
command:
nice program
您可以使用它来运行JVM进程:
And you could use that to run a JVM process:
nice java -jar program.jar
该JVM进程运行的Java程序将启动多个线程.
The Java program run by that JVM process will start multiple threads.
nice
更改是否会影响那些Java线程的调度?也就是说,当Java线程以以下方式运行时,其CPU优先级是否会降低
Does the nice
change affect the scheduling of those Java threads? That is, will the Java threads have a lower CPU priority when run as
nice java -jar program.jar
以...方式运行时
java -jar program.jar
通常,这将取决于系统,因此我对Linux的情况很感兴趣.
In general, this will be system dependent, so I am interested in teh Linux case.
推荐答案
实际上...根据POSIX.1,尼斯性是应用程序的一个属性.这是更详细的帖子. 是nice(),用于更改线程优先级还是进程优先级?
Actually...Niceness is a property of the application according to POSIX.1. Here is a more detailed post. is nice() used to change the thread priority or the process priority?
这篇关于“不错"吗?影响Java线程的优先级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!