Home » , , , » Download PDF Efficient Android Threading by Anders Göransson

Download PDF Efficient Android Threading by Anders Göransson


Sinopsis

Android devices are multiprocessor systems that can run multiple operations simultaneously, but it is up to each application to ensure that operations can be partitioned and executed concurrently to optimize application performance. If the application doesn’t enable partitioned operations but prefers to run everything as one long operation, it can exploit only one CPU, leading to suboptimal performance. Unpartitioned operations must run synchronously, whereas partitioned operations can run asynchronously. With asynchronous operations, the system can share the execution among multiple CPUs and therefore increase throughput.

An application with multiple independent tasks should be structured to utilize asynchronous execution. One approach is to split application execution into several processes, because those can run concurrently. However, every process allocates memory for its own substantial resources, so the execution of an application in multiple processes will use more memory than an application in one process. Furthermore, starting and communicating between processes is slow, and not an efficient way of achieving asynchronous execution. Multiple processes may still be a valid design, but that decision should be independent of performance. To achieve higher throughput and better performance, an application should utilize multiple threads within each process.

Content

  1. Android Components and the Need for Multiprocessing
  2. Multithreading in Java
  3. Threads on Android
  4. Thread Communication
  5. Interprocess Communication
  6. Memory Management
  7. Asynchronous Techniques
  8. Managing the Lifecycle of a Basic Thread
  9. HandlerThread: A High-Level Queueing Mechanism
  10. Control over Thread Execution Through the Executor Framewor
  11. Tying a Background Task to the UI Thread with AsyncTask
  12. Services
  13. IntentService
  14. Access Content Providers with AsyncQueryHandler
  15. Automatic Background Execution with Loaders
  16. Summary: Selecting an Asynchronous Technique



0 komentar:

Posting Komentar