Equipment IO queue method based on atomic operation

An atomic operation and queue technology, applied in the field of computer system software programming, can solve the problems of complex implementation of atomic queues, excessive overhead and impracticality, and achieve the effect of speeding up data input and output and saving computing resources.

Active Publication Date: 2015-05-13
CHANGSHA XINHONG SOFTWARE
View PDF4 Cites 10 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This kind of general atomic queue is too complicated to implement, and the overhead is too large in actual specific applications, which is not practical

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
  • Equipment IO queue method based on atomic operation
  • Equipment IO queue method based on atomic operation
  • Equipment IO queue method based on atomic operation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] As shown in Figure 1: When performing enqueue operations, first use atomic swap to replace the tail pointer with a pointer pointing to a new node, and take out the pointer of the original tail node at the same time. Then point the link pointer of the original end node to the new end node. If the original tail pointer is empty, directly point the first pointer to the new node, indicating that the new node is the first node in the queue, and it also means that the producer who submitted the new node has obtained control of the queue, that is, the producer It can be transformed into a consumer to take out nodes from the queue. Because the atomic operation guarantees the order of submission, when there are multiple producers enqueuing at the same time, only one producer can gain control.

[0022] As shown in Figure 2: Use the atomic swap operation to replace the tail pointer pointing to the fourth node with the pointer pointing to the fifth node, and take out the pointer p...

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 an equipment IO queue method based on atomic operation. A queue is composed of an owner pointer, a tail pointer, data nodes and temporary nodes. The enqueue operation can be simultaneously carried out by a plurality of producers, and the dequeue operation can only be carried out by a consumer. The dequeue operation needs one temporary node to participate, and the first data node in the queue is replaced and taken out. In the process, the atomic compare-and-swap (CAS) operation is used to judge whether the tail pointer points to the first data node or not; if yes, the tail pointer points to the temporary node. The queue further comprises control power releasing operation, and the control power releasing operation is as follows: the first node is removed, and the atomic compare-and-swap (CAS) operation is used to judge whether the tail pointer points to the first node or not; if yes, the tail pointer is changed to a null pointer; if the first node is removed, so that the queue is emptied, the control power is released.

Description

technical field [0001] The invention relates to the field of computer system software programming, in particular to an atomic operation-based device IO queue method. Background technique [0002] In the computer system, the access to the device IO is exclusive. Even in a symmetric multiprocessor system, even if it seems that multiple tasks are accessing a certain hardware device at the same time from the user's point of view, in the actual operation process of the bottom layer, it is By submitting the requests in the queue to the hardware device one by one to complete the deserialization. Although some hardware supports command queues inside the hardware, software queues are still required to manage other requests. This involves the mutual exclusion problem of multiple tasks accessing the IO queue at the same time. Generally, locks are used in the design to control the problem of multiple tasks accessing the queue at the same time, that is, only one task can successfully ob...

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/44
Inventor 龙恢管志坚
Owner CHANGSHA XINHONG SOFTWARE
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