I am currently working on an android project written in java.
I have a dashboard that queries data from a cloudant database and renders the data on graphs. the data however has to be processed when received.
I have 4 AsyncTasks that process the received data in the doInBackground Override method simultaneously (or is supposed to). The process being very slow, I tried the line
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
in each AsyncTask.
However, the 4 AsynkTasks seem to all happen one after the other, is that due to changing the priority of the threads to max? When a thread priority is changed, does it stop all other threads and continue with just the one until it finishes?
From: https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html
Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority. Each thread may or may not also be marked as a daemon. When code running in some thread creates a new Thread object, the new thread has its priority initially set equal to the priority of the creating thread, and is a daemon thread if and only if the creating thread is a daemon.
(as a note: this information was found by searching "java Thread.MAX_PRIORITY" in google and looking at the top result)