Method for achieving unlocked concurrence message processing mechanism

An implementation method and mechanism technology, which is applied in the implementation field of lock-free concurrent message processing mechanism, and can solve problems such as low efficiency, false sharing, unfavorable cache read-ahead, etc.

Inactive Publication Date: 2014-10-01
CSIC WUHAN LINCOM ELECTRONICS
View PDF1 Cites 34 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] (1) The linked list nodes are scattered and not in the same storage area, which is not conducive to cache pre-reading
[0008] (2) Linked list nodes need to apply for or release memory every time they operate, which is relatively inefficient
[0009] (3) The customary programming method causes the three variables of head pointer, tail pointer and capacity to be in one cache line, causing false sharing problems
[0010] (4) A large number of lock operations cause inefficiency

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 for achieving unlocked concurrence message processing mechanism
  • Method for achieving unlocked concurrence message processing mechanism
  • Method for achieving unlocked concurrence message processing mechanism

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0036] In order to facilitate those of ordinary skill in the art to understand and implement the present invention, the present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the implementation examples described here are only used to illustrate and explain the present invention, and are not intended to limit this invention.

[0037] The technical solution adopted by the present invention is: a method for realizing a lock-free concurrent message processing mechanism, the buffer for storing message data adopts a circular array structure instead of a linked list structure, so that data is stored in the same storage area, which is convenient for cache pre-processing Read, and at the same time avoid the need to apply for or release memory operations for each operation of the linked list node, and improve efficiency; the length of the ring array is set to an exponential multiple of 2, an...

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 for achieving an unlocked concurrence message processing mechanism. An annular array is used as a data buffering area, caching and pre-reading can be facilitated, meanwhile, the defect that memory needs to be applied or released at each node operation caused by a chain table structure is overcome, and the efficiency is improved. In order to solve the concurrence control problem of a multiple-producer and single-consumer mode, a CAS and a memory barrier are used for guaranteeing mutual exclusion, a locking mode is not used, and performance deterioration caused by low efficiency of locking is avoided. In order to solve the common ABA problem in the unlocked technology, a double-insurance CAS technology is used for avoiding the occurrence of the ABA problem. In order to solve the false sharing problem, the method that cache lines are filled between a head pointer, a tail pointer and capacity is used for avoiding the false sharing problem due to the fact that the head pointer, the tail pointer and the capacity are in the same cache line. Meanwhile, the length of the array is set to be the index times of two, the bit operation of 'and operation' is used for acquiring the subscript of the array, and the overall efficiency is improved.

Description

[0001] technical field [0002] The invention belongs to the technical field of computer software engineering, and relates to a method for realizing a lock-free concurrent message processing mechanism. [0003] Background technique [0004] In a message-driven system, the message processing mechanism is the focus and difficulty of the system, and the quality of the message processing mechanism affects the stability and efficiency of the entire system. [0005] Existing message processing mechanisms are generally implemented based on queues (implemented by linked lists) and lock algorithms. The message queue is stored in a linked list structure. For multi-threaded operations on shared data, semaphores and locks are used to solve synchronization and mutual exclusion problems. [0006] There are several points in the existing mechanism that have a great impact on performance: [0007] (1) The linked list nodes are scattered and not in the same storage area, which is not con...

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/38
Inventor 袁浩曾令将
Owner CSIC WUHAN LINCOM ELECTRONICS
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products