Method, system and terminal device capable of calling asynchronous procedure
An asynchronous process and thread technology, applied in the direction of multi-program device, program startup/switching, etc., can solve the problems of unrealized asynchronous process call, complex callback logic, thread deadlock, etc., to improve orderly collaboration and execution efficiency, Avoid thread deadlock and call logic is simple
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0036] figure 1 It is a flow chart of the first preferred embodiment of an asynchronous procedure calling method of the present invention. Described method comprises the following steps:
[0037] S101, the first thread sends a service request through the service interface, returns and continues to execute subsequent instructions;
[0038] Before the first thread sends a service request to the second thread for the first time, it first needs to explain the service object;
[0039] The service object is the authentication certificate provided by the second thread, and the first thread must first present the authentication certificate before sending the service request to the second thread, and the second thread passes the authentication before responding to the service request of the first thread;
[0040] After the first thread sends the service request, it does not need to wait for the feedback result, returns and continues to execute subsequent instructions;
[0041] S102....
Embodiment 2
[0045] figure 2 It is a flow chart of the second preferred embodiment of an asynchronous procedure calling method of the present invention. Described method comprises the following steps:
[0046] S201, the first thread sends a service request through the service interface, creates a third thread, returns and continues to execute subsequent instructions of the first thread; wherein, the priority of the third thread is higher than that of the first thread;
[0047] After the third thread is created, it enters the state of waiting for messages;
[0048] The third thread needs to be created only during initialization, and only needs to send service requests in other cases;
[0049] S202. The second thread receives and processes the service request, generates a first processing result, and feeds back the first processing result to the third thread through a callback function;
[0050] S203. The third thread receives the first processing result, preempts CPU resources of the fi...
Embodiment 3
[0056] image 3 It is a flow chart of the third preferred embodiment of an asynchronous procedure calling method of the present invention. Described method comprises the following steps:
[0057] S301, the first thread sends a service request through the service interface, creates a third thread, returns and continues to execute subsequent instructions of the first thread; wherein, the priority of the third thread is higher than that of the first thread;
[0058] S302. The second thread receives and processes the service request, and generates a first processing result;
[0059] S303. The callback function puts the first processing result into the message queue of the third thread;
[0060] The synchronization mechanism used here is message queue, or other synchronization mechanisms;
[0061] S304. The third thread sequentially acquires the messages according to the arrangement of the messages in the message queue;
[0062] S305. The third thread preempts the CPU resources...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com