What's the difference between Thread.setPriority() and android.os.Process.setThreadPriority() -
if have code like:
runnable r = ...; thread thread = new thread(r); thread.setpriority((thread.max_priority + thread.norm_priority) / 2);
or ...
runnable r = ... thread thread = new thread( new runnable() { public void run() { android.os.process.setthreadpriority(android.os.process.thread_priority_more_favorable); r.run(); } });
is android.os.process way required/preferred?
why android.os.process way preferred/required if is?
this not documented far can tell.
the current dalvik implementation seems map java threads ony 1 underlying linux system pthreads say. threads of apps belong same thread group on system, every thread competes threads of apps.
so thread.setpriority
should same process.setthreadpriority
, using smaller java priority scale, mapping of priorities defined in knicevalues
@ vm/thread.c
Comments
Post a Comment