Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Thread.MIN_优先级_Android_Thread Priority - Fatal编程技术网

Android Thread.MIN_优先级

Android Thread.MIN_优先级,android,thread-priority,Android,Thread Priority,在我的android应用程序中,我有一些逻辑,可以将线程池中所有线程的优先级设置为thread.MIN_priority,该优先级的整数值为1 但是当我做了一个 adb shell ps -t -p 它给了我这个: thread_4 15581 15060 628480 139992 39 19 0 0 c00d12b0 40106600 S Downloader #1 其中39应该是线程的优先级 我对Thread.MIN_PRIORITY如何转换为39感

在我的android应用程序中,我有一些逻辑,可以将线程池中所有线程的优先级设置为thread.MIN_priority,该优先级的整数值为1

但是当我做了一个

adb shell ps -t -p
它给了我这个:

thread_4     15581 15060 628480 139992 39    19    0     0     c00d12b0 40106600 S Downloader #1
其中39应该是线程的优先级


我对Thread.MIN_PRIORITY如何转换为39感到困惑?

我怀疑他们是否在直接改变优先级——他们几乎肯定是在用它设置好的值,这是下一篇专栏文章的内容。nice越低优先级越高,其级别为-20,19。另一个优先级是由操作系统linux计算的,这里不是android,它将根据程序行为(如IO使用情况及其被阻止的时间)进行更改。除了Gabe的注释外,您还可以使用设置系统pthread priority,AKA。ps命令输出19中的nice列是最小值。