I am new to threading and i went through many post in stack overflow and find many solution for my problem but i am not sure which one is best for which condition.
First thing first, my problem is that i want to update one JSON file when all threads are done with the bitmap generation at a specific path so that i can get that all those image and update JSON file. So in simple word my i want to run some code when all thread are done with it execution and major requirement is that i don't want my main to be blocked because of this.
What i have found out
- thread. join
- excutorServive
- android-priority-jobQueue (link)
- Mutex in threadpool ( also let me know if any other is there)
I am confused which one is the best way to tackle my problem. if any android expert out there can summarise that for following the two scenerio what is the best available in android.
- wait till when all thread completes
- don't wait and get informed when all completes