A thread is a mechanism enabling a single process to perform multiple tasks concurrently. Threads are lightweight processes sharing the same memory and resources of the same parent process. A single process can contain multiple threads executing in parallel. As part of the same process, threads can communicate with each other and share data. Android supports threads in both Java and the native code. In this chapter, you will be exploring different strategies and APIs that can be used for concurrent programming pertaining to native code. The following key topics are covered in this chapter:
- Java vs. POSIX Threads
- Thread synchronization
- Controlling the thread lifecycle
- Thread priorities and scheduling strategies ...