Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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

Inactive Publication Date: 2012-07-11
融创天下(上海)科技发展有限公司
View PDF5 Cites 38 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] The purpose of the embodiments of the present invention is to propose a method, system and terminal equipment for asynchronous procedure calls, aiming to solve the problem that the application layers in the prior art are generally synchronous procedure calls, and asynchronous procedure calls are not implemented; and the callback mechanism is not clear or logical Errors, entering the system kernel by mistake, waiting for resources for a long time, thread deadlock, complex callback logic, and technical problems that lead to data access exceptions when the frequency of callbacks is high

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, system and terminal device capable of calling asynchronous procedure
  • Method, system and terminal device capable of calling asynchronous procedure
  • Method, system and terminal device capable of calling asynchronous procedure

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method, a system and a terminal device capable of calling an asynchronous procedure. The method disclosed by the invention comprises the following steps: returning and continuing executing a follow-up command after a first thread sends a service request; receiving and processing the service request by a second thread, generating a first processing result, and feeding back the first processing result to a third thread through a callback function; and generating a second processing result by the third thread according to the first processing result. According to the method disclosed by the invention, after the first thread sends the service request, and the waiting for a feedback result is not required, so that thread deadlock can be avoided and call logic is simple. When initialization is performed, the first thread is used for creating the third thread, the priority of the third thread is higher than that of the first thread, after the first processing result is received, the resources of a CPU (central processing unit) of the first thread are occupied, the second processing result is finally generated, and access exception can be avoided even callback frequency is higher.

Description

technical field [0001] The present invention relates to the field of procedure calls, in particular to a method, system and terminal equipment for asynchronous procedure calls. Background technique [0002] At present, the design of the callback function between the application layers is generally a synchronous procedure call, and no asynchronous procedure call is implemented. [0003] If the client thread and the server thread use synchronous procedure calls, when the server thread processes the service request, the client thread can only be in a waiting state. Only when the server thread finishes processing the service request can the client thread continue to run other Instructions, low efficiency. [0004] If the client thread and the server thread use asynchronous procedure calls, then after the server thread responds to the service request and generates processing results, it needs to call external hardware to continue processing other instructions, which is inefficie...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/48
Inventor 刘骁
Owner 融创天下(上海)科技发展有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products