An optimization method, computer equipment and storage medium
An optimization method and computer program technology, applied in the computer field, can solve problems such as process crash, and achieve the effect of improving stability and reducing the number of threads
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0064] see figure 1 , an optimization method provided in this embodiment includes the following steps:
[0065] S101. Create an RPC communication instance.
[0066] Specifically, creating an RPC communication instance includes: calling an RpcCreateInstance method to create an RPC instance. The prototype of the RpcCreateInstance function is as follows:
[0067] HRPC RpcCreateInstance(RpcTransferMethod method, bool isServer, RpcCallbackFunction, void*userData)
[0068] It can be seen that the function receives 4 parameters, the first parameter method indicates what kind of data communication method is used, the optional value includes RPM_NAMED_PIPE, which means that the named pipe is used for data transmission; and includes RPM_TCP_SOCKET, which means that TCP is used for data transmission ; Also includes RPM_UDP_SOCKET, which means UDP is used for data transmission.
[0069] The second parameter isServer indicates whether to create an RPC server instance. When this paramet...
Embodiment 2
[0100] see figure 2 , the optimization device provided in this embodiment includes:
[0101] A first creating unit 201, configured to create an RPC communication instance;
[0102]The first setting unit 202 is configured to set a first variable, the first variable is used to indicate whether to create the RPC main thread of the RPC communication instance, and the RPC main thread is used to handle the execution of the RPC task queue, wherein, by In the RpcBase class of the RPC module, the first variable of a bool type is added, and the initial value of the first variable is false, indicating that the RPC main thread needs to be created; if it is not necessary to create the RPC main thread, by calling The RpcSetProperty method of the RPC module changes the value of the first variable to true, indicating that the RPC main thread does not need to be created;
[0103] The second setting unit 203 is configured to set a second variable, the second variable is used to indicate whet...
Embodiment 3
[0111] This embodiment provides a computer-readable storage medium 300, the computer-readable storage medium 300 stores a computer program 311, and the computer program 311 implements the following steps when executed by a processor:
[0112] Create an RPC communication instance;
[0113] Set the first variable, the first variable is used to indicate whether to create the RPC main thread of the RPC communication instance, the RPC main thread is used to handle the execution of the RPC task queue, wherein, by adding in the RpcBase class of the RPC module The first variable of a bool type, the initial value of the first variable is false, indicating that the RPC main thread needs to be created; if the RPC main thread does not need to be created, the RpcSetProperty method of the RPC module will be called The value of the first variable is changed to true, indicating that the RPC main thread does not need to be created;
[0114] Set the second variable, the second variable is used...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


