android asynctask - What exactly does thread priority do in Java -
this question has answer here:
- java multithreading - thread priority 5 answers
i working on android project written in java. have dashboard queries data cloudant database , renders data on graphs. data has processed when received.
have 4 asynctasks process received data in doinbackground override method simultaneously (or supposed to). process being slow, tried line
thread.currentthread().setpriority(thread.max_priority);
in each asynctask.
however, 4 asynktasks seem happen 1 after other, due changing priority of threads max? when thread priority changed, stop other threads , continue 1 until finishes?
from: https://docs.oracle.com/javase/7/docs/api/java/lang/thread.html
every thread has priority. threads higher priority executed in preference threads lower priority. each thread may or may not marked daemon. when code running in thread creates new thread object, new thread has priority set equal priority of creating thread, , daemon thread if , if creating thread daemon.
(as note: information found searching "java thread.max_priority" in google , looking @ top result)
Comments
Post a Comment