IPC communication method and server
A communication method and notification signal technology, applied in the directions of instruments, inter-program communication, program synchronization, etc., can solve problems such as unresolved, untimely server response, and complexity, and achieve the effects of reducing processing, reducing energy consumption, and improving response speed.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0033] figure 1 It is a schematic flow chart of an IPC communication method of the present invention. The method is applied to the receiving side, and the receiving side includes: monitoring the parent process, monitoring a plurality of mutually independent message processing child processes and shared memory created by the monitoring parent process; the shared memory is used to store notification signal marks and messages written by the sender; the The method flow shown in the embodiment includes the following steps:
[0034] Step S11, the message processing sub-process accesses the shared memory.
[0035]The receiving side includes a plurality of message processing sub-processes, and the above-mentioned sub-processes may be sub-processes that have ended dormancy or may be sub-processes awakened by a monitoring parent program. Specifically, the message processing sub-process accesses the shared memory by reading unprocessed messages in the shared memory.
[0036] Step S12,...
Embodiment 2
[0050] figure 2 It is a schematic flow chart of a kind of IPC communication method of the present invention, on the basis of embodiment 1, also includes the step under the situation that there are more than two unprocessed messages in the shared memory, when the message processing sub-process judges how many messages there are in the shared memory When there are two unprocessed messages, the specific steps are as follows:
[0051] Step S21, setting the status of the notification signal flag as invalid, and reading and processing unprocessed messages.
[0052] The above notification signal is marked as invalid so that the sender does not send a new message notification signal to the receiver when a new message is written into the shared memory.
[0053] When there are more than two unprocessed messages in the shared memory, that is, when it is busy, there are still pending messages in the queue after a subprocess processes a pending message, and the message processing subproc...
Embodiment 3
[0058] image 3 It is a schematic flow diagram of an IPC communication method of the present invention, and the method flow shown in this embodiment includes the following steps:
[0059] Step S31, write the message into the shared memory of the receiver.
[0060] The operation of sending data from the sender to the receiver is realized by writing data to the shared memory of the receiver. After the data is written, it is necessary to determine whether to send a notification signal to the receiver according to the notification signal value set by the receiver in the shared memory.
[0061] Specifically include: obtaining the write operation lock of the message queue on the shared memory; judging whether the message queue is full; when the message queue is not full, writing a message in the area pointed to by the read pointer of the current queue, and then releasing the write operation lock; When it is full, continue to execute the step of judging whether the message queue is ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


