Unlock instant, AI-driven research and patent intelligence for your innovation.

Multithread asynchronous-to-synchronous message processing method, terminal, medium and system

A message processing, multi-threading technology, applied in the field of computer communication, can solve the problems of difficult to achieve asynchronous to synchronous conversion, synchronous lock cannot be unlocked, etc., and achieve the effect of efficient asynchronous to synchronous and efficient conversion

Pending Publication Date: 2022-04-01
深圳健路网络科技有限责任公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, when a multi-thread synchronization request occurs, the synchronization lock will not be unlocked, and it is difficult to realize the conversion from asynchronous to synchronous

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
  • Multithread asynchronous-to-synchronous message processing method, terminal, medium and system
  • Multithread asynchronous-to-synchronous message processing method, terminal, medium and system
  • Multithread asynchronous-to-synchronous message processing method, terminal, medium and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0040] The inventive idea of ​​the present invention is: aiming at the multi-thread concurrent application scenario of full-duplex asynchronous communication, design a router (Router), generate a collector (Collector) for each request, and add it to the router, and the collector Design a message filter (Filter) in the collector; when receiving a message, the router traverses the message filters of all collectors, and the message filter judges wheth...

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 embodiment of the invention discloses a multi-thread asynchronous-to-synchronous message processing method, which is suitable for full-duplex asynchronous communication and comprises the following steps: sending a request message or a request command to a server through a write thread; generating a collector according to the request message or the request command; the collector comprises a message filter and a blocking queue, and the blocking queue is used for realizing write thread blocking; adding the plurality of collectors into a router; reading the return message through the reading thread, and sending the return message to the router; traversing the message filters of all collectors through the router to judge whether the return message is the request message or the return message of the request command; if yes, the return message is pressed into a blocking queue, blocking of the write thread is relieved, the write thread obtains the return message, and therefore asynchronous-to-synchronous conversion of the read-write thread is achieved. By implementing the embodiment of the invention, efficient asynchronous-to-synchronous conversion under multiple concurrency can be realized.

Description

technical field [0001] The invention relates to the technical field of computer communication, in particular to a multi-thread asynchronous-to-synchronous message processing method, terminal, medium and system. Background technique [0002] In full-duplex communication such as network and serial port, the read thread and write thread usually communicate asynchronously. The so-called asynchronous communication means that after the sender sends data, it sends the next data packet without waiting for the receiver to send back a response. However, in many practical application scenarios, it is required to adopt a synchronous communication method, that is, the next command can only be executed after receiving the return message of the command. [0003] In order to meet the requirements of synchronous communication in actual application scenarios, synchronous locks can be used in the prior art to implement the function of asynchronous to synchronous. However, when a multi-thread...

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
IPC IPC(8): G06F9/52
Inventor 赵文博罗军
Owner 深圳健路网络科技有限责任公司