Android Process Communication Threads for Freeze-Free IPC
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Inter-process communication in Android systems can cause mobile terminals to freeze, restart, and lag due to system processes attempting to communicate with application processes when all threads in the application process are in use.
Innovation Solution
A method that determines the availability of idle communication threads in the application process thread pool and creates a target communication thread if none are available, ensuring smooth communication by using these threads to interact with system processes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the system process requests to communicate with the application process when all threads in the application process are in working state, then inter-process communication can be established, but the mobile terminal will freeze, restart, and laggy
Solution Approach 1:
The system creates a dedicated communication thread in advance before the application process needs to communicate with the system process. This preliminary action ensures that a ready-to-communicate thread is available, preventing the system from freezing when communication is requested, while maintaining normal application thread operations.
2Reliability
If a communication thread is created for each communication request, then communication can be established even when all threads are in use, but the thread pool management complexity increases
Solution Approach 1:
The thread pool is segmented into two distinct categories: communication threads dedicated to system-process communication and application threads for application logic. This segmentation allows independent management of each thread type, simplifying the creation and destruction of communication threads while maintaining communication availability.
Solution Approach 2:
A communication thread acts as an intermediary between the system process and the application process. This intermediary thread handles communication protocols and data transfer, isolating the complexity of inter-process communication from the application threads and enabling reliable communication without increasing overall system complexity.
Data Source
AI summary
A process communication method and apparatus, a storage medium, and a mobile terminal. The method comprises: when a system process needs to communicate with an application process, determining whether an idle communication thread is present in a thread pool of the application process (101); if no idle communication thread is present in the thread pool of the application process, creating a first target communication thread (102); and communicating with the system process using the first target communication thread (103). By creating a target communication thread in a thread pool of an application process, abnormalities such as a frozen screen, restart and stuttering of a mobile terminal are avoided.


