Android Thread Process.setThreadPriority
<pre><code>public class MainActivity extends Activity {

private int newThreadCount;
private int uiCount;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Thread t = new Thread() {
        @Override
        public void run() {
            //Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
            while (true) {
                newThreadCount++;
            }
        }
    };
    t.start();
    while (uiCount &lt; 100000000) {
        uiCount++;
    }
    Log.d("TEST", "uiCount=" + uiCount + " newThreadCount=" + newThreadCount);
}
</code></pre>

<p>I know
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND)</p>

<p>let Thread t run in <strong>bg_non_interactive</strong> cgroups</p>

<ol>
<li>Run the code above, Log print uiCount=100000000 and newThreadCount=50000000(around)</li>
<li>Remove Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND) then
    run the code again, Log print is almost the same.</li>
</ol>

<p>So what is the function of Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND)?</p>