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

A method of using ring cache and ring queue to realize efficient concurrency of udp

A circular queue and cache technology, applied in electrical components, transmission systems, etc., can solve problems such as client reception failures, reduce CPU idling time, improve CPU utilization, and avoid reception failures

Inactive Publication Date: 2017-11-24
INTEGRATED ELECTRONICS SYST LAB
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This is a commonly used method at present, but the biggest problem with this method is that the child thread will create a new socket and bind a new port to communicate with the client. If the client specifies to receive data from a certain port of the server, it will cause the client to Failed to receive

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
  • A method of using ring cache and ring queue to realize efficient concurrency of udp
  • A method of using ring cache and ring queue to realize efficient concurrency of udp

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0027] The implementation process of the present invention is described in detail below in conjunction with accompanying drawing:

[0028] A method for realizing UDP efficient concurrency using a ring buffer and a ring queue, as shown in the figure, includes the following steps:

[0029] (1) Create a socket for the data receiving thread and bind a port, initiate the data receiving thread of the server, and create a ring queue.

[0030] (2) The data receiving thread receives data at the binding port. If legal data is received, the communication address in the data (referring to the IP address of the source client or the communication address of the device contained in the data) is used to determine whether the corresponding client already exists. If there is a data processing sub-thread at the end, directly perform step (4); if not, perform step (3) first to create a new data processing sub-thread, and then perform step (4). Data legitimacy is judged based on the comprehensive...

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 relates to the technical field of UDP concurrency, in particular to a method for realizing efficient UDP concurrency by using a ring cache and a ring queue. The characteristics are as follows: Create a ring queue in the data receiving thread to store the client ID of the data to be returned, and create a sending ring buffer and a receiving ring buffer in the data processing sub-thread for receiving data and storing the data to be sent; data receiving The thread receives the data and checks whether there is a client ID that needs to return data in the ring queue at the same time. If there is a corresponding data processing sub-thread, the data in the ring buffer is sent out. The circular buffer of the present invention can provide mutually exclusive access to the buffer, so there is no need to add mutual exclusion protection between the data receiving thread and the data processing sub-thread, and it can be carried out simultaneously, thereby having good concurrent performance, and the circular buffer can be Better utilization of system memory resources.

Description

technical field [0001] The invention relates to the technical field of UDP concurrency, in particular to a method for realizing efficient UDP concurrency by using a ring cache and a ring queue. Background technique [0002] UDP, short for User Datagram Protocol, is a connectionless transport layer protocol in the OSI (Open System Interconnection, Open System Interconnection) reference model, providing transaction-oriented simple and unreliable information transmission services. [0003] Currently, there are three methods for UDP to achieve concurrency: [0004] 1. Loop mode: Create a socket, bind it to a port, and receive a request on this port, enter an infinite loop, in which the server accepts the next request from the client, processes this request, This response is then sent back to the client. This mode takes a long time to process requests and is relatively inefficient. We consider a service like file transfer, which requires a considerable amount of time to proces...

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 Patents(China)
IPC IPC(8): H04L29/06
Inventor 孙明刚
Owner INTEGRATED ELECTRONICS SYST LAB