I have two statements that call two methods from C++ files in the jni library in my Android app. For example -
x1 = function1();
x2 = function2();
Each of these methods take about 8 seconds to return a value (due to some data processing). My aim is to have these be executed simultaneously and not one after the other (which is causing a delay of 16 seconds).
I tried making two Runnables, but then I realized they get added to the same queue.
I don't want to extend the Thread class because I don't want these function calls to be looped (I need them to be called only when I want)
Is there a solution where I can call them both simultaneously just once and have them return their values at about the same time?